Merge pull request #2162 from halseth/make-goimports

[Makefile] Define `make imports`
This commit is contained in:
Johan T. Halseth
2021-01-29 08:54:00 +01:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ GOINSTALL := GO111MODULE=on go install -v
GOTEST := GO111MODULE=on go test
GOVERSION := $(shell go version | awk '{print $$3}')
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go")
RM := rm -f
CP := cp
@@ -245,7 +245,9 @@ fuzz-run: $(GOFUZZ_BIN)
# UTILITIES
# =========
fmt:
fmt: goimports
@$(call print, "Fixing imports.")
goimports -w $(GOFILES_NOVENDOR)
@$(call print, "Formatting source.")
gofmt -l -w -s $(GOFILES_NOVENDOR)