Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golangci-lint action incorrectly abuses GOOS to get cross-platform linting #39589

Open
efd6 opened this issue May 16, 2024 · 1 comment
Open
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@efd6
Copy link
Contributor

efd6 commented May 16, 2024

The current golangci-lint action configuration uses GOOS to try to lint on platforms other than the OS that the builder is running on.

    strategy:
      matrix:
        include:
          - GOOS: windows
          - GOOS: linux
          - GOOS: darwin
    name: lint
    runs-on: ubuntu-latest

This has the effect that when the analyser runs it may be in a situation where it cannot get all the required type information to be able to complete the analysis. Unfortunately, in this situation it does not simply fail, but emits incorrect linter advice that people then try to fix.

The situation where this most commonly will happen is when the build includes Cgo dependencies, as beats do.

The correct approach would be to use the Multiple OS Support provided by the action.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 16, 2024
@efd6 efd6 added the Team:Elastic-Agent Label for the Agent team label May 16, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

2 participants