-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use go 1.17 run syntax in makefile tasks (#132)
replace old workaround and go install with go run syntax. Formatting also took care of an issue introduced in go 1.19 with the style changes around documentation/comments.
- Loading branch information
Showing
2 changed files
with
9 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
GOPATH?=~/go | ||
|
||
.phony: update | ||
update: fmt lic imports | ||
|
||
.PHONY: lic | ||
lic: $(GOPATH)/bin/go-licenser | ||
go-licenser | ||
lic: | ||
go run github.com/elastic/go-licenser@latest | ||
|
||
.PHONY: fmt | ||
fmt: $(GOPATH)/bin/gofumpt | ||
gofumpt -w -l ./ | ||
fmt: | ||
go run mvdan.cc/gofumpt@latest -w -l ./ | ||
|
||
.PHONY: imports | ||
imports: $(GOPATH)/bin/goimports | ||
goimports -l -local github.com/elastic/go-sysinfo ./ | ||
|
||
$(GOPATH)/bin/go-licenser: | ||
@echo "go-licenser missing, installing" | ||
go install github.com/elastic/go-licenser@latest | ||
|
||
$(GOPATH)/bin/gofumpt: | ||
@echo "gofumpt missing, installing" | ||
#Ugly boilerplate for go mod installs | ||
cd $(mktemp -d); go mod init tmp; go get mvdan.cc/gofumpt | ||
|
||
$(GOPATH)/bin/goimports: | ||
@echo "goimports missing, installing" | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
imports: | ||
go run golang.org/x/tools/cmd/goimports@latest -l -local github.com/elastic/go-sysinfo ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters