From 5e9109e492b6f719004dfdd7caa77dc4b907e4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Thu, 28 Jan 2021 11:25:33 +0100 Subject: [PATCH] Add support for goimports as well as go fmt Convenience targets, instead of "make lint" Because golangci-lint is so big and slow... --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 4d137b5836..479ea268ff 100644 --- a/Makefile +++ b/Makefile @@ -418,6 +418,15 @@ gofmt: ## Run go fmt and list the files differs from gofmt's vet: ## Run go vet @go vet $(SOURCE_PACKAGES) +.PHONY: imports +imports: ## Run goimports and modify files in place + @goimports -w $(SOURCE_DIRS) + +.PHONY: goimports +goimports: ## Run goimports and list the files differs from goimport's + @goimports -l $(SOURCE_DIRS) + @test -z "`goimports -l $(SOURCE_DIRS)`" + .PHONY: golint golint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go ## Run golint @golint -set_exit_status $(SOURCE_PACKAGES)