@@ -16,42 +16,53 @@ WINDOWS=$(BINARY_NAME)-windows.exe
1616.PHONY : test lint vet install generate
1717
1818bench : # # Run all benchmarks in the Go application
19+ @echo " running benchmarks..."
1920 @go test -bench=. -benchmem
2021
2122build-go : # # Build the Go application (locally)
23+ @echo " building go app..."
2224 @go build -o bin/$(BINARY_NAME )
2325
2426clean-mods : # # Remove all the Go mod cache
27+ @echo " cleaning mods..."
2528 @go clean -modcache
2629
2730coverage : # # Shows the test coverage
31+ @echo " creating coverage report..."
2832 @go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
2933
3034generate : # # Runs the go generate command in the base of the repo
35+ @echo " generating files..."
3136 @go generate -v
3237
3338godocs : # # Sync the latest tag with GoDocs
39+ @echo " syndicating to GoDocs..."
3440 @test $(GIT_DOMAIN )
3541 @test $(REPO_OWNER )
3642 @test $(REPO_NAME )
3743 @test $(VERSION_SHORT )
3844 @curl https://proxy.golang.org/$(GIT_DOMAIN ) /$(REPO_OWNER ) /$(REPO_NAME ) /@v/$(VERSION_SHORT ) .info
3945
4046install : # # Install the application
47+ @echo " installing binary..."
4148 @go build -o $$ GOPATH/bin/$(BINARY_NAME )
4249
4350install-go : # # Install the application (Using Native Go)
51+ @echo " installing package..."
4452 @go install $(GIT_DOMAIN ) /$(REPO_OWNER ) /$(REPO_NAME )
4553
4654lint : # # Run the golangci-lint application (install if not found)
55+ @echo " installing golangci-lint..."
4756 @# Travis (has sudo)
48- @if [ " $( shell command -v golangci-lint) " = " " ] && [ $( TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.0 && sudo cp ./bin/golangci-lint $(go env GOPATH ) /bin/; fi ;
57+ @if [ " $( shell command -v golangci-lint) " = " " ] && [ $( TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.1 && sudo cp ./bin/golangci-lint $(go env GOPATH ) /bin/; fi ;
4958 @# AWS CodePipeline
50- @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( CODEBUILD_BUILD_ID) " != " " ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH ) /bin v1.42.0 ; fi ;
59+ @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( CODEBUILD_BUILD_ID) " != " " ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH ) /bin v1.42.1 ; fi ;
5160 @# Github Actions
52- @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( GITHUB_WORKFLOW) " != " " ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH ) /bin v1.42.0 ; fi ;
61+ @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( GITHUB_WORKFLOW) " != " " ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH ) /bin v1.42.1 ; fi ;
5362 @# Brew - MacOS
5463 @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( shell command -v brew) " != " " ]; then brew install golangci-lint; fi ;
64+ @# MacOS Vanilla
65+ @if [ " $( shell command -v golangci-lint) " = " " ] && [ " $( shell command -v brew) " != " " ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v1.42.1; fi ;
5566 @echo " running golangci-lint..."
5667 @golangci-lint run --verbose
5768
@@ -61,6 +72,7 @@ test: ## Runs lint and ALL tests
6172 @go test ./... -v
6273
6374test-unit : # # Runs tests and outputs coverage
75+ @echo " running unit tests..."
6476 @go test ./... -race -coverprofile=coverage.txt -covermode=atomic
6577
6678test-short : # # Runs vet, lint and tests (excludes integration tests)
@@ -88,6 +100,7 @@ test-no-lint: ## Runs just tests
88100 @go test ./... -v
89101
90102uninstall : # # Uninstall the application (and remove files)
103+ @echo " uninstalling go application..."
91104 @test $(BINARY_NAME )
92105 @test $(GIT_DOMAIN )
93106 @test $(REPO_OWNER )
@@ -97,11 +110,13 @@ uninstall: ## Uninstall the application (and remove files)
97110 @rm -rf $$ GOPATH/bin/$(BINARY_NAME )
98111
99112update : # # Update all project dependencies
113+ @echo " updating dependencies..."
100114 @go get -u ./... && go mod tidy
101115
102116update-linter : # # Update the golangci-lint package (macOS only)
117+ @echo " upgrading golangci-lint..."
103118 @brew upgrade golangci-lint
104119
105120vet : # # Run the Go vet application
106121 @echo " running go vet..."
107- @go vet -v ./...
122+ @go vet -v ./...
0 commit comments