If following the GoLang documentation for workspace structure it is possible that two executable packages will share the same package name.
For example, there are two packages from github:
$ $GOPATH/src/github.com/alpha/import
$ $GOPATH/src/github.com/beta/import
The import
package from user alpha
is first installed:
$ go install github.com/alpha/import
The binary executable is now available in $GOPATH/bin
and is named import
.
Then the second package from user beta
is installed:
$ go install github.com/beta/import
This install/build will replace the existing import
binary from user alpha
with the import
binary from user beta
.
A better naming convention could avoid this collision; however, is there a standard practice for fixing this issue when using third party libraries?
This collision happens only for executables and never for packages. Executables are much less common and often have distinguishing names so in practice I never encountered this problem.
The "fix" or "best practice" is obvious and dead simple: Just rename the binary after installing.