# check-fmt returns an error code if any source code contains format error.
check-fmt:
@test -z $(shell gofmt -s -l $(GO_SRC)| tee /dev/stderr)||echo"[WARN] Fix formatting issues with 'make fmt'"
@ -98,15 +107,27 @@ ifndef HAS_GOX
($(GO) get $(PKG_GOX))
endif
ifndefHAS_GOLANGCI
(curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${GOPATH}/bin v${PKG_GOLANGCI_LINT_VERSION})
(curl -sfL $(PKG_GOLANGCI_LINT_SCRIPT)| sh -s -- -b ${GOPATH}/bin v${PKG_GOLANGCI_LINT_VERSION})
endif
ifdefHAS_GOLANGCI
ifeq($(HAS_GOLANGCI_VERSION),)
ifdefINTERACTIVE
@echo "Warning: Your installed version of golangci-lint (interactive: ${INTERACTIVE}) differs from what we'd like to use. Switch to v${PKG_GOLANGCI_LINT_VERSION}? [Y/n]"
@read line;if[$$line=="y"];then(curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${GOPATH}/bin v${PKG_GOLANGCI_LINT_VERSION});fi
@read line;if[$$line=="y"];then(curl -sfL $(PKG_GOLANGCI_LINT_SCRIPT)| sh -s -- -b ${GOPATH}/bin v${PKG_GOLANGCI_LINT_VERSION});fi
else
@echo "Warning: you're not using the same version of golangci-lint as us (v${PKG_GOLANGCI_LINT_VERSION})"
endif
endif
endif
ci-setup:
@echo "Installing Go tools..."
curl -sfL $(PKG_GOLANGCI_LINT_SCRIPT)| sh -s -- -b ${GOPATH}/bin v$(PKG_GOLANGCI_LINT_VERSION)