Like Nigel suggested

project/
  internal/
     testhelper



On Sunday, 18 December 2016 21:45:25 UTC+11, Henry wrote:
>
> No. I meant something like this:
>
> project/
> -- package1
> -- package2
> -- package3
>
> Now there is a reusable test utility that is used by the tests in 
> package1, package2, and package3. So the question is where do I put the 
> test utility without exposing them as a part of the project's API? I don't 
> want the test utility to get compiled into the final binary as it is 
> supposed to be part of the test.
>
> On Sunday, December 18, 2016 at 5:30:20 PM UTC+7, Nigel Tao wrote:
>
>> On Sun, Dec 18, 2016 at 1:51 PM, Henry <henry.ad...@gmail.com> wrote: 
>> > I have reusable test utilities in a project. They are used by various 
>> > packages in the project for testing purposes, and at the same time I 
>> don't 
>> > want to expose these utilities as public APIs. Since it is impossible 
>> to 
>> > import another test package in Go, I wonder what would be the best way 
>> to 
>> > package these utilities. 
>>
>> It sounds like you want an internal package. See 
>> https://golang.org/s/go14internal 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to