[go-nuts] Re: Test code that interacts with private variables and doesn't bloat binary

2017-01-17 Thread C Banning
See TestMain() documentation in "Overview" for https://golang.org/pkg/testing/ On Tuesday, January 17, 2017 at 12:28:34 AM UTC-7, alcub...@gmail.com wrote: > > I'm trying to test my packages without bloating the size of the binary. > Currently this consists of moving the test code into a test/

[go-nuts] Re: Test code that interacts with private variables and doesn't bloat binary

2017-01-17 Thread alcubecker
Ah, then my fundamental structure was wrong. Since the code didn't contain any tests, I had it in a file named init_mock.go, and it was getting pulled into the binary. So you're saying I should have all test-only code in a file named *_test.go, including code that doesn't contain any tests? On

[go-nuts] Re: Test code that interacts with private variables and doesn't bloat binary

2017-01-16 Thread Volker Dobler
I' unsure if I understand the problem but code in *_test.go is not compiled into the production binary, so there is no need to extract test code into its own package: Keeping this in _test.go is probably okay. V. Am Dienstag, 17. Januar 2017 08:28:34 UTC+1 schrieb alcub...@gmail.com: > > I'm