简体   繁体   中英

golangci-lint run command shows errors in makefile

I have created a make file to run some bash commands for Go.

This is check.sh file

This is my make file

Error is: make: *** [Makefile:23: check] Error 1

How can I solve this issue?

According to this stackoverflow answer that happens if one of the commands exits with exit code.= 0. That is the case if golangci-lint finds something to complain about.

Try putting the call to golangci-lint directly in the make file.

From my Makefiles:

lint:
    golangci-lint run

Have you created mod file in the root folder?

go mod init <root folder /Application Name>

if yes, check for the bin folder if the specified package is installed, if not install the package,

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Then add it in make file

lint:
       golangci-lint run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM