Skip to content

Commit ab462fb

Browse files
silverwindtboerger
authored andcommitted
Makefile: Use hash over which (#1069)
`hash` is a much faster shell-builtin alternative to `which`.
1 parent a307974 commit ab462fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ vet:
4747

4848
.PHONY: generate
4949
generate:
50-
@which go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
50+
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
5151
go get -u github.com/jteeuwen/go-bindata/...; \
5252
fi
5353
go generate $(PACKAGES)
5454

5555
.PHONY: errcheck
5656
errcheck:
57-
@which errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
57+
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
5858
go get -u github.com/kisielk/errcheck; \
5959
fi
6060
errcheck $(PACKAGES)
6161

6262
.PHONY: lint
6363
lint:
64-
@which golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
64+
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
6565
go get -u github.com/golang/lint/golint; \
6666
fi
6767
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
@@ -105,7 +105,7 @@ release-dirs:
105105

106106
.PHONY: release-build
107107
release-build:
108-
@which xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
108+
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
109109
go get -u github.com/karalabe/xgo; \
110110
fi
111111
xgo -dest $(DIST)/binaries -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets '$(TARGETS)' -out $(EXECUTABLE)-$(VERSION) .

0 commit comments

Comments
 (0)