From 562e6e24a68545aff89e1ddd5c613aad141a293e Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Mon, 29 Jul 2019 10:25:20 -0400 Subject: [PATCH 1/4] Install missing goimports on CI pipeline --- .circleci/config.yml | 2 +- Makefile | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca6235e..d4a119c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: key: repo-{{ .Environment.CIRCLE_SHA1 }} - run: name: Check formatting of all go files - command: make checkfmt + command: make goimports checkfmt lint: <<: *defaults diff --git a/Makefile b/Makefile index 9afdcf7..0c637f8 100644 --- a/Makefile +++ b/Makefile @@ -162,12 +162,17 @@ authors: ## Generate Authors changelog: ## Generate Changelog git-chglog --config hack/chglog --output CHANGELOG.md +.PHONY: goimports +goimports: ## Install goimports + @ $(MAKE) --no-print-directory log-$@ + @ cd /tmp && go get -u golang.org/x/tools/cmd/goimports + .PHONY: tools tools: ## Install required tools @ $(MAKE) --no-print-directory log-$@ @ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) @ curl -sfL https://github.com/git-chglog/git-chglog/releases/download/$(GITCHGLOG_VERSION)/git-chglog_$(shell go env GOOS)_$(shell go env GOARCH) -o $(shell go env GOPATH)/bin/git-chglog && chmod +x $(shell go env GOPATH)/bin/git-chglog - @ cd /tmp && go get -v -u github.com/mitchellh/gox + @ cd /tmp && go get -u github.com/mitchellh/gox #################################### ## Self-Documenting Makefile Help ## From 9b6f6b6e64f63949a2ccc40dcc30d63352a66082 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Mon, 29 Jul 2019 11:04:37 -0400 Subject: [PATCH 2/4] Show command --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c637f8..98cf5d3 100644 --- a/Makefile +++ b/Makefile @@ -165,7 +165,8 @@ changelog: ## Generate Changelog .PHONY: goimports goimports: ## Install goimports @ $(MAKE) --no-print-directory log-$@ - @ cd /tmp && go get -u golang.org/x/tools/cmd/goimports + @ cd /tmp + go get -u golang.org/x/tools/cmd/goimports .PHONY: tools tools: ## Install required tools From 5454efbf8486b739959ef87291add2007c1620c8 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Mon, 29 Jul 2019 11:15:43 -0400 Subject: [PATCH 3/4] Do not use go modules --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 98cf5d3..1db3c28 100644 --- a/Makefile +++ b/Makefile @@ -165,15 +165,14 @@ changelog: ## Generate Changelog .PHONY: goimports goimports: ## Install goimports @ $(MAKE) --no-print-directory log-$@ - @ cd /tmp - go get -u golang.org/x/tools/cmd/goimports + GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports .PHONY: tools tools: ## Install required tools @ $(MAKE) --no-print-directory log-$@ @ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) @ curl -sfL https://github.com/git-chglog/git-chglog/releases/download/$(GITCHGLOG_VERSION)/git-chglog_$(shell go env GOOS)_$(shell go env GOARCH) -o $(shell go env GOPATH)/bin/git-chglog && chmod +x $(shell go env GOPATH)/bin/git-chglog - @ cd /tmp && go get -u github.com/mitchellh/gox + @ GO111MODULE=off go get -u github.com/mitchellh/gox #################################### ## Self-Documenting Makefile Help ## From 9850c4c431a87fe8d1a5b656b985f81b72d1a80e Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Mon, 29 Jul 2019 11:17:50 -0400 Subject: [PATCH 4/4] Show 'tools' commands --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1db3c28..b8c6600 100644 --- a/Makefile +++ b/Makefile @@ -170,9 +170,9 @@ goimports: ## Install goimports .PHONY: tools tools: ## Install required tools @ $(MAKE) --no-print-directory log-$@ - @ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) - @ curl -sfL https://github.com/git-chglog/git-chglog/releases/download/$(GITCHGLOG_VERSION)/git-chglog_$(shell go env GOOS)_$(shell go env GOARCH) -o $(shell go env GOPATH)/bin/git-chglog && chmod +x $(shell go env GOPATH)/bin/git-chglog - @ GO111MODULE=off go get -u github.com/mitchellh/gox + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) + curl -sfL https://github.com/git-chglog/git-chglog/releases/download/$(GITCHGLOG_VERSION)/git-chglog_$(shell go env GOOS)_$(shell go env GOARCH) -o $(shell go env GOPATH)/bin/git-chglog && chmod +x $(shell go env GOPATH)/bin/git-chglog + GO111MODULE=off go get -u github.com/mitchellh/gox #################################### ## Self-Documenting Makefile Help ##