导出结构仅用于在Golang中进行测试
  我有许多其他软件包使用的实用程序包。  我还创建了一些实现这些接口的测试结构。  我把它们放在interfaces_test.go 
  我希望能够在我的*_test.go文件中的其他包中导入这些测试结构。 
我在http://golang.org/src/pkg/os/export_test.go中看到类似的东西,但是无论我尝试什么,我都会得到与此类似的错误:
go test something/mypackage
mypackage/ant_lat_lon_test.go:46: undefined: rutl.TestAntenner
FAIL    something/mypackage [build failed]
有没有办法做到这一点?
  匹配*_test.go文件只在测试它们所属的包*_test.go被编译。  如果您正在测试使用软件包B的软件包A,则无法访问软件包B中的_test.go代码。 
所以这两个选项是:
上一篇: Export structure only for testing in Golang
下一篇: popBackStack causes calling oncreateView of fragment again and again
