On Thursday, February 22, 2018 at 5:29:23 PM UTC+8, Axel Wagner wrote:
> Have you read https://research.swtch.com/vgo-import? It talks about 
> singletons and also how to solve that with different import paths.
> Note, that this is also independent of *how* the different import paths 
> are represented and distributed; for singletons it only matters what import 
> paths the compiler sees, whether they are committed physical directories or 
> whether the vgo tool automatically resolves them.

Yup, the package I'm working on really cannot have 2 instances even in 
different import paths as it deals with a shared resource and code that 
must be run on the main thread.
So I have to choose between daisy chaining v1 to v2 to v3 etc.. or have a 
central v0 where all the v1, v2, etc.. packages import.

Daisy chaining would mean I would only have to code API translations for 
the latest API but then it's debug hell and if one version in the chain 
it means fixing all the newer versions. Also there's a performance hit 
going through many translations.

Having a v0 means non of all the daisy chaining problems but it means more 
work when there's a breaking change as then I'll have to update all 
Also it means that all version packages have to be from the same release or 
it breaks. 

If I just have one module at the root, is it right to assume all sub 
packages would be of the same commit and that there will be only one 
version of the module?

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