
用 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 Apr 18, 2018 go test |
2 LuoyeBug Apr 18, 2018 上代码呀,github 有个 gotests 工具,挺省事的。 |
3 gowk Apr 18, 2018 推荐这个 repo: https://github.com/quii/learn-go-with-tests |
4 justfortest Apr 18, 2018 你是不是没有以 package 方式执行?这样会导致一些 exported variable/method 无法被引用。 |