appliedgocode / goman

The missing man page for Go binaries. Goman fetches the repo's readme as a man page replacement.
Other
123 stars 3 forks source link

Binaries compiled outside GOPATH (using go.mod) seem to contain no source path anymore #6

Closed christophberger closed 2 years ago

christophberger commented 5 years ago

Go 1.11:

Compiling outside GOPATH, or compiling with GO111MODULES=on, appears to create a binary that does not contain the source path anymore.

Symptoms:

$ goman goman
No source path in /home/christoph/go/bin/goman - goman is perhaps no Go binary

Counter test: when compiling the same tool from within GOPATH (with GO111MODULE=auto or off), goman can find the source path.

christophberger commented 5 years ago

Reason:

$ goman -v ag 
No source path in /Users/christoph/go/bin/ag - ag is perhaps no Go binary
path is absolute but contains no '/src/' dir: /Users/christoph/go/pkg/mod/github.com/christophberger/ag@v0.0.0-20181030131239-f9f9e70594cd

Cause: func stripPath expects /src/ in path