用 goLand 的 ide 编写 go 的单元测试,但是一 run 就发现 ./w_test.go:11:7: undefined: NewWeightedRR ./w_test.go:11:21: undefined: RR_NGINX ./w_test.go:60:7: undefined: NewWeightedRR ./w_test.go:60:21: undefined: RR_LVS
说是我的引用有点问题,请问哪位 v 友遇到过吗
1
cloudzhou 2018 年 4 月 18 日
go test
|
2
LuoyeBug 2018 年 4 月 18 日
上代码呀,github 有个 gotests 工具,挺省事的。
|
3
gowk 2018 年 4 月 18 日
推荐这个 repo: https://github.com/quii/learn-go-with-tests
|
4
justfortest 2018 年 4 月 18 日
你是不是没有以 package 方式执行?这样会导致一些 exported variable/method 无法被引用。
|