第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

這構(gòu)建得很好。為什么這段代碼不執(zhí)行?

這構(gòu)建得很好。為什么這段代碼不執(zhí)行?

Go
慕桂英546537 2022-01-10 14:40:10
我正在嘗試使用 go 制作網(wǎng)絡(luò)爬蟲(chóng)。我構(gòu)建了這段代碼。它構(gòu)建良好,沒(méi)有任何錯(cuò)誤。但它的二進(jìn)制文件不會(huì)執(zhí)行。這是大量例程或執(zhí)行函數(shù)中的那些變量的問(wèn)題嗎?package mainimport (    "io/ioutil"    "net/http"    //"regexp")func excuter(count int) {    adrr := string("http://torhit.com/torbite/?page=" + string(count))    resp, _ := http.Get(adrr)    bytes, _ := ioutil.ReadAll(resp.Body)    ioutil.WriteFile("scrap.txt"+string(count), bytes, 0777)    resp.Body.Close()}func main() {    //re := regexp.MustCompile("")    count := 1    maxcount := 200    for ; count <= maxcount; count++ {        go excuter(count)    }}    package mainimport (    "io/ioutil"    "net/http"    //"regexp")func excuter(count int) {    adrr := string("http://torhit.com/torbite/?page=" + string(count))    resp, _ := http.Get(adrr)    bytes, _ := ioutil.ReadAll(resp.Body)    ioutil.WriteFile("scrap.txt"+string(count), bytes, 0777)    resp.Body.Close()}func main() {    //re := regexp.MustCompile("")    count := 1    maxcount := 200    for ; count <= maxcount; count++ {        go excuter(count)    }}
查看完整描述

1 回答

?
幕布斯6054654

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊

也許你的錯(cuò)誤來(lái)自這個(gè):

string(count)

它將編譯但結(jié)果為空。如果要將 int 轉(zhuǎn)換為 string,則需要 strconv 包。

strconv.Itoa(count)

或者

strconv.FormatInt(int64(count), 10)


查看完整回答
反對(duì) 回復(fù) 2022-01-10
  • 1 回答
  • 0 關(guān)注
  • 154 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)