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

Problems installing goman #3

Closed carlca closed 7 years ago

carlca commented 7 years ago

macOS 10.12.5 Sierra Golang 1.8.3

The first problem I had was that if I used the -u parameter, I got an error message:

go get -u github.com/christophberger/goman
package golang.org/x/crypto/ssh/terminal: directory "/Users/carlca/Code/go/src/golang.org/x/crypto/ssh/terminal" is not using a known version control system

Typing go get github.com/christophberger/goman ie. without the -u parameter grabbed the files ok. The second problem is that any attempt to do anything with goman.go meets with an error:

 ~/C/g/s/g/c/goman   master   go run goman.go
# command-line-arguments
./goman.go:80: undefined: getMainPath
 ✘  ~/C/g/s/g/c/goman   master   go build goman.go
# command-line-arguments
./goman.go:80: undefined: getMainPath
 ✘  ~/C/g/s/g/c/goman   master   go install goman.go
# command-line-arguments
./goman.go:80: undefined: getMainPath

Thanks in advance, Carl

christophberger commented 7 years ago

Try go build or go install in the goman directory without any parameters.

Or run go run goman.go dwarf.go to include all required files. go run only follows imports but does not touch any other files even if they are in the same directory.

But usually, go get already includes go install, so goman might already be in your $GOPATH/bin.

The first part of the problem (the go get -u failure) is a bit strange, as I cannot repro it (also with Go 1.8.3 on macOS 10.12.5). The -v flag (go get -u -v...) might reveal more details on this.

carlca commented 7 years ago

Hi Christoph, go build and 'go install` worked perfectly. Thanks very much.

As for the first part of the problem, I tried the -v flag and got:

 ~/C/g/s/github.com  go get -u -v github.com/christophberger/goman
github.com/christophberger/goman (download)
package golang.org/x/crypto/ssh/terminal: directory "/Users/carlca/Code/go/src/golang.org/x/crypto/ssh/terminal" is not using a known version control system

I'm happy now because the goman command is working, but if you want me to try anything else to shed some light on the first problem, by all means ask me.

carlca commented 7 years ago

I think the first part of the problem may be related to some earlier problems I had configuring Git - it probably has nothing to do with goman.

christophberger commented 7 years ago

Makes sense. I had a look into /Users/christoph/go/src/golang.org/x/crypto but this repo is using Git (and not Mercury or Bazaar or SVN - which might have explained the error message). So maybe it is indeed a Git problem.

Another possible cause is that, for some reason, crypto/ssh/terminal was not vendored. (Fixed now.)

carlca commented 7 years ago

Interesting. I've just tried it again, and the problem has disappeared. Maybe that thing you just fixed did indeed solve the problem. Thanks again for your efforts in solving this. It's much appreciated!

christophberger commented 7 years ago

At least the vendoring problem that I fixed seems to have been part of the problem. Glad to hear it works now.