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

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

去測(cè)試錯(cuò)誤 - 沒(méi)有測(cè)試文件 - GOPATH中的錯(cuò)誤

去測(cè)試錯(cuò)誤 - 沒(méi)有測(cè)試文件 - GOPATH中的錯(cuò)誤

Go
富國(guó)滬深 2022-06-13 17:38:43
在以下環(huán)境中:code$ pwd/home/user1/codecode$ echo $GOPATH/home/user1/golib:/home/user1/codecode$ lsbin  pkg  src code$ ls src/github.com/myhub/codingtest/main.go  test_main.gocode$ code$ code$ code$ code$ code$ cat src/github.com/myhub/codingtest/test_main.go package mainimport "testing"func TestSplit(t *testing.T) {        gotAllButLast, gotLast := split(2013)        wantAllButLast := 201        wantLast := 3        if gotAllButLast != wantAllButLast {                t.Errorf("got %d but expected %d", gotAllButLast, wantAllButLast)        }        if wantLast != gotLast {                t.Errorf("got %d but expected %d", gotLast, wantLast)        }}code$ code$ code$ code$ code$ code$ cat src/github.com/myhub/codingtest/main.go package main// Spit n into all but its last digit and its last digitfunc split(n int) (int, int) {        return n / 10, n % 10}func main() {}code$ go test給出以下錯(cuò)誤:code$ go test github.com/myhub/codingtest?       github.com/myhub/codingtest   [no test files]code$ code$ code$ code$ code$ code$ 如何解決no test files error?
查看完整描述

1 回答

?
當(dāng)年話(huà)下

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

要解決您的錯(cuò)誤,您需要將 test_main.go 重命名為 main_test.go

正如您在文檔中看到的

要編寫(xiě)新的測(cè)試套件,請(qǐng)創(chuàng)建一個(gè)名稱(chēng)以 _test.go 結(jié)尾的文件


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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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