You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build this library go build ./... and got error:
# github.com/seancfoley/ipaddress-go/ipaddr/cmd
ipaddr/cmd/test.go:25:6: main redeclared in this block
ipaddr/cmd/main.go:37:6: other declaration of main
The text was updated successfully, but these errors were encountered:
I've taken a look at this issue and your associated PR.
I haven't quite made up my mind, but it's likely that I will not merge your associated PR as the solution, which moves the test.go main function into the ipaddr/test package, because the test package is meant to contain code for that package only and not a second package. AFAIK, the usual go convention is to avoid having a go "main" package source file in the same folder as other packages, so as not to mix the library or test code with application code to create binaries.
I've looked into how the go community usually handles this situation of having multiple binaries, and while there are not a lot of resources out there addressing this, I have found more than one resource suggesting that each binary should be in its own subfolder of the cmd folder, so I'm likely gonna do that, which should address this.
I tried to build this library
go build ./...
and got error:The text was updated successfully, but these errors were encountered: