From a12a1a9e01b5a14def902e6eee0ae4556a0c670c Mon Sep 17 00:00:00 2001 From: Vyacheslav Pryimak Date: Mon, 25 Dec 2023 00:35:36 +0200 Subject: [PATCH] goanalysis short fixes --- Makefile | 14 +++++++------- pkg/goanalysis/README.md | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 pkg/goanalysis/README.md diff --git a/Makefile b/Makefile index 6a582f6..1712098 100644 --- a/Makefile +++ b/Makefile @@ -21,31 +21,31 @@ build-all-lint: build-lint-windows-386 build-lint-windows-amd64 build-lint-macos .PHONY: build-lint-windows-386 build-lint-windows-386: - GOOS=windows GOARCH=386 go build -tags linter,osusergo -o bin/windows-386/goimportsreviserlint.exe ./linter + GOOS=windows GOARCH=386 go build -o bin/windows-386/goimportsreviserlint.exe ./pkg/goanalysis/analyzer.go .PHONY: build-lint-windows-amd64 build-lint-windows-amd64: - GOOS=windows GOARCH=amd64 go build -tags linter,osusergo -o bin/windows-amd64/goimportsreviserlint.exe ./linter + GOOS=windows GOARCH=amd64 go build -o bin/windows-amd64/goimportsreviserlint.exe ./pkg/goanalysis/analyzer.go .PHONY: build-lint-macos-amd64 build-lint-macos-amd64: - GOOS=darwin GOARCH=amd64 go build -tags linter,osusergo -o bin/macos-amd64/goimportsreviserlint ./linter + GOOS=darwin GOARCH=amd64 go build -o bin/macos-amd64/goimportsreviserlint ./pkg/goanalysis/analyzer.go .PHONY: build-lint-macos-arm64 build-lint-macos-arm64: - GOOS=darwin GOARCH=arm64 go build -tags linter,osusergo -o bin/macos-arm64/goimportsreviserlint ./linter + GOOS=darwin GOARCH=arm64 go build -o bin/macos-arm64/goimportsreviserlint ./pkg/goanalysis/analyzer.go .PHONY: build-lint-linux-386 build-lint-linux-386: - GOOS=linux GOARCH=386 go build -tags linter,osusergo -o bin/linux-386/goimportsreviserlint ./linter + GOOS=linux GOARCH=386 go build -o bin/linux-386/goimportsreviserlint ./pkg/goanalysis/analyzer.go .PHONY: build-lint-linux-amd64 build-lint-linux-amd64: - GOOS=linux GOARCH=amd64 go build -tags linter,osusergo -o bin/linux-amd64/goimportsreviserlint ./linter + GOOS=linux GOARCH=amd64 go build -o bin/linux-amd64/goimportsreviserlint ./pkg/goanalysis/analyzer.go .PHONY: build-lint-linux-arm64 build-lint-linux-arm64: - GOOS=linux GOARCH=arm64 go build -tags linter,osusergo -o bin/linux-arm64/goimportsreviserlint ./linter + GOOS=linux GOARCH=arm64 go build -o bin/linux-arm64/goimportsreviserlint ./pkg/goanalysis/analyzer.go .PHONY: build-macos-amd64 build-macos-amd64: diff --git a/pkg/goanalysis/README.md b/pkg/goanalysis/README.md new file mode 100644 index 0000000..4235bdb --- /dev/null +++ b/pkg/goanalysis/README.md @@ -0,0 +1,17 @@ +goimports-reviser analyzer +--- + +### Build +Choose one of the binary(inside `./bin` dir) to your current OS & Arch types after the Make command: +```shell +make build-all-lint +``` + +### Run with `go vet` +```shell +go vet -vettool=bin/macos-amd64/goimportsreviserlint ./... +``` + +Output: + +!['linter output'](../images/linter-example.png)