我试图让这个测试套件通过命令提示符 (hello-world_test.go):package helloworldimport "testing"func TestHelloWorld(t *testing.T) { output := sayHello() if "Hello, World!" != output { t.Fatalf("output: %s\nexpected: Hello,World!", output) }}我的代码如下(helloworld.go):package helloworldimport "fmt"func sayHello() { fmt.Println("Hello, World!")}并且通过命令提示符的错误代码是:C:\Users\Troy\exercism\go\hello-world\go test -v# _/C_/Users/Troy/exercism/go/hello-world.\hello-world_test.go:6: sayHello() used as valueFAIL _/C_/Users/Troy/exercism/go/hello-world [build failed]
2 回答
- 2 回答
- 0 关注
- 165 浏览
添加回答
举报
0/150
提交
取消