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

panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt #440

Closed
dprotaso opened this issue Apr 4, 2022 · 4 comments
Closed
Labels
question Further information is requested upstream related the golangci-lint but not to the action

Comments

@dprotaso
Copy link

dprotaso commented Apr 4, 2022

Config

  - id: golangci_configuration
    uses: andstor/file-existence-action@v1
    with:
      files: .golangci.yaml
  - name: Go Lint
    if: steps.golangci_configuration.outputs.files_exists == 'true'
    uses: golangci/golangci-lint-action@v2
    with:
      version: v1.43

logs

2022-04-04T14:16:03.6399430Z Requested golangci-lint 'v1.43', using 'v1.43.0', calculation took 1011ms
2022-04-04T14:16:03.6400387Z Installing golangci-lint v1.43.0...
2022-04-04T14:16:03.6401074Z Downloading https://github.com/golangci/golangci-lint/releases/download/v1.43.0/golangci-lint-1.43.0-linux-amd64.tar.gz ...
2022-04-04T14:16:03.9937418Z [command]/usr/bin/tar xz --overwrite --warning=no-unknown-keyword -C /home/runner -f /home/runner/work/_temp/687aab17-ebb5-472e-900d-0ea5ec7c1e69
2022-04-04T14:16:04.2305141Z Installed golangci-lint into /home/runner/golangci-lint-1.43.0-linux-amd64/golangci-lint in 591ms
2022-04-04T14:16:05.1596175Z Received 0 of 177591248 (0.0%), 0.0 MBs/sec
2022-04-04T14:16:06.1668429Z Received 75497472 of 177591248 (42.5%), 35.9 MBs/sec
2022-04-04T14:16:07.1671375Z Received 169202640 of 177591248 (95.3%), 53.6 MBs/sec
2022-04-04T14:16:07.4620890Z Received 177591248 of 177591248 (100.0%), 51.3 MBs/sec
2022-04-04T14:16:07.4622386Z Cache Size: ~169 MB (177591248 B)
2022-04-04T14:16:07.4658217Z [command]/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/ecdff63e-a86a-4f59-b247-e043aa8cb958/cache.tzst -P -C /home/runner/work/serving/serving
2022-04-04T14:16:11.1174878Z Cache restored successfully
2022-04-04T14:16:11.4239596Z Restored cache for golangci-lint from key 'golangci-lint.cache-2726-fc03b2b43aa16194ba6daf2c98ffd484f54e1140' in 8796ms
2022-04-04T14:16:11.4240401Z Prepared env in 8797ms
2022-04-04T14:16:11.4241449Z ##[endgroup]
2022-04-04T14:16:11.4243464Z ##[group]run golangci-lint
2022-04-04T14:16:11.4247003Z Running [/home/runner/golangci-lint-1.43.0-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
2022-04-04T14:16:31.4411167Z panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
2022-04-04T14:16:31.4412001Z 
2022-04-04T14:16:31.4413141Z goroutine 1 [running]:
2022-04-04T14:16:31.4413837Z github.com/go-critic/go-critic/checkers.init.9()
2022-04-04T14:16:31.4414655Z 	github.com/go-critic/go-critic@v0.6.1/checkers/checkers.go:58 +0x4b4
2022-04-04T14:16:31.4415083Z 
2022-04-04T14:16:31.4445261Z ##[error]golangci-lint exit with code 2
2022-04-04T14:16:31.4458573Z Ran golangci-lint in 20017ms
@vanderson139
Copy link

vanderson139 commented Apr 4, 2022

Solved here, i skipped go installation and setup 1.17 on previous ci step, as in here https://github.com/foxygoat/foxtrot/blob/86646cb58e7ebe90daf354e5005143b71a260961/.github/workflows/cicd.yaml#L29

- uses: actions/setup-go@v2
    with:
    go-version: 1.17.x

- uses: golangci/golangci-lint-action@v2.5.2
    with:
        version: v1.43
        skip-go-installation: true
        args: --version

@SVilgelm
Copy link
Member

SVilgelm commented Apr 4, 2022

Please upgrade to v3 of the action, it does not install go anymore, so you have a full control on go version

dprotaso added a commit to dprotaso/actions that referenced this issue Apr 4, 2022
This fixes the panic in golangci-lint: golangci/golangci-lint-action#440
knative-prow bot pushed a commit to knative/actions that referenced this issue Apr 4, 2022
This fixes the panic in golangci-lint: golangci/golangci-lint-action#440
@dprotaso
Copy link
Author

dprotaso commented Apr 4, 2022

bumping v3 worked :)

thanks!

@dprotaso dprotaso closed this as completed Apr 4, 2022
@dmateusp
Copy link

dmateusp commented Apr 5, 2022

For reference I just wanted to share my config

      - uses: actions/setup-go@v3
        with:
          go-version: '1.17.8'
          check-latest: false
      - uses: actions/checkout@v2
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: v1.44.2

on v2 I had the same issue pointed out here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested upstream related the golangci-lint but not to the action
Projects
None yet
Development

No branches or pull requests

5 participants