在以下环境中: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给出以下错误: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 回答
- 0 关注
- 158 浏览
添加回答
举报
0/150
提交
取消