目录结构为:
src
src/pkg
src/pkg/t1.go
src/pkg/t1_test.go
t1.go
package pkg
import (
"fmt"
)
func SayHI(){
fmt.Println("this is t1")
}
t1_test.go
package pkg
import (
"testing"
)
func TestXYZ(t *testing.T) {
SayHI()
}
从dir的命令行调用go测试 src/pkg
go test t1_test.go
错误:
./t1_test.go:8: undefined: SayHI
FAIL command-line-arguments [build failed]
但是功能在那里
慕码人2483693
吃鸡游戏
相关分类