Skip to content

How to avoid false positive typecheck errors when running golangci-lint #5008

Answered by ldez
nuhasha asked this question in Q&A
Discussion options

You must be logged in to vote

I saw the message you deleted, and now I know where your problem is.

You are using private modules but those modules are not available inside your CI, so you have typechek errors.

To validate that:

  • you need to add a step to download your modules before running the linter (I think it will fail)
  • After this new step add a step to build your program (I think it will fail too)
      - name: download dependencies
        run: go mod tidy
        
      - name: build
        run: go build .

      - name: golangci-lint
      # ...

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@ldez
Comment options

ldez Sep 13, 2024
Maintainer

@nuhasha
Comment options

@ldez
Comment options

ldez Sep 13, 2024
Maintainer

@ldez
Comment options

ldez Sep 16, 2024
Maintainer

Answer selected by nuhasha
@nuhasha
Comment options

@ldez
Comment options

ldez Sep 16, 2024
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants