This is touched upon in this blog post <https://blog.golang.org/organizing-go-code>. It is confusing that the import path would not match the package it contains.
On Wednesday, March 29, 2017 at 6:18:52 PM UTC+11, Dorival Pedroso wrote: > > Hello, > > I haven't noticed that the code below (located at *$GOPATH/src/MyWrapper* > ): > > package mylib > > import "fmt" > > func SayHello() { > fmt.Println("hello") > } > > is actually being installed (go install) as a *MyWrapper* package, even > though the package name was explicitly given as *mylib*. > > I couldn't find in the documentation where the handling of this situation > is described; i.e. how the final package name is decided (apparently the > directory name is chosen). > > Anyway, so, why using *package mylib* then? > > Cheers. > Dorival > > > -- 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.