1

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?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Kashif Khan
  • 97
  • 2
  • 11
  • 1
    [Please do not upload images of code/errors when asking a question.](//meta.stackoverflow.com/q/285551) – blami Jan 20 '21 at 12:04

2 Answers2

2

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
TehSphinX
  • 6,536
  • 1
  • 24
  • 34
  • When i call to golangci-lint directly from Makefile it shows an error that "golangci-lint command not found" – Kashif Khan Jan 21 '21 at 05:43
  • Is `golangci-lint` in your PATH? Usually it gets installed to $GOPATH/bin which by default is $HOME/go/bin. That folder should be added to the PATH environment variable. – TehSphinX Jan 21 '21 at 08:20
0

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
VIVEK S
  • 1
  • 1