On Friday, 28 February 2020 20:43:16 UTC+1, Paul Hankin wrote:
>
> I am rather confused about modules, and have trouble making them work.
>
> I have a package: https://github.com/paulhankin/poker
>
> The go.mod looks like this: `
> module github.com/paulhankin/poker/v2
>
> go 1.13
> `
>
> The package has a v1, and v2. At v2, I moved the main part of the package 
> into a subdirectory "poker" so the import would be "
> github.com/paulhankin/poker/v2/poker" rather than "
> github.com/paulhankin/poker/v2".
>
> I can successfully import the v2 package in a new modules-aware project, 
> and goproxy seems to pick up new versions:
>
> $ go list -m --versions
> github.com/paulhankin/poker/v2 v2.0.0 v2.0.2 v2.0.3 v2.0.4 v2.0.5 v2.0.6 
> v2.0.7
>
>
> I can't find the documentation on go.dev though. The closest I can find 
> is this:
> https://pkg.go.dev/github.com/paulhankin/poker/v2
> which contains the cmd subdirectory, but not the poker subdirectory.
>
> Am I doing something wrong? Did I make a mistake in moving the package 
> into a subdirectory, or is there an easier way to avoid the import name 
> being "v2"?
>
> I'd file a bug against go.dev if I thought it was broken, but I find 
> modules so complicated that I don't know if it's my understanding that's 
> wrong, or if I made a mistake, or if go.dev isn't working correctly. I'm 
> pretty frustrated with the experience so far.
>

Oh, I see the problem. I created the subdirectory after tagging v2.0.0.

-- 
Paul Hankin

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/21888ea2-b3a6-4340-adaa-2d8f9c07402e%40googlegroups.com.

Reply via email to