Repository navigation
Makefile: don't look for golint and godep in specific places - #1588
Conversation
Using $GOPATH/bin/godep or $GOPATH/bin/golint is problematic because $GOPATH can contain multiple colon-separated paths. We should just run these like normal binaries. The user should make sure their $PATH contains $GOPATH/bin, if necessary. This is part of normal Go setup. Signed-off-by: Aaron Lehmann <[email protected]>
Current coverage is
|
|
LGTM |
|
|
||
| GODEP_BIN := $(GOPATH)/bin/godep | ||
| GODEP := $(shell [ -x $(GODEP_BIN) ] && echo $(GODEP_BIN) || echo '') | ||
| GOLINT := $(shell which golint || echo '') |
There was a problem hiding this comment.
Why not just rely on $PATH? No reason to fix these outright using which, when that will be done automatically. How did this get in here in the first place?
There was a problem hiding this comment.
@stevvooe: I left this in to preserve the
$(if $(GOLINT), , \
$(error Please install golint: `go get -u github.com/golang/lint/golint`)) ```
I'm not sure how to do that without calling `which` or doing something similar to search $PATH. If you have any suggestions, let me know.
There was a problem hiding this comment.
@aaronlehmann Would that statement work like this:
$(if $(which golint), , \ ...If golint isn't available, which should return non-zero.
There was a problem hiding this comment.
I think so (with $(shell which golint)). That's what I was going for in this PR. Do you think it would be cleaner to move the which golint from GODEP := to the conditional?
There was a problem hiding this comment.
Yea, I just don't think we should be doing which lookups like this.
Using $GOPATH/bin/godep or $GOPATH/bin/golint is problematic because
$GOPATH can contain multiple colon-separated paths.
We should just run these like normal binaries. The user should make sure
their $PATH contains $GOPATH/bin, if necessary. This is part of normal
Go setup.