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

Go version 1.20 specified in config file causes linting against Go 1.2. #669

Closed
3 tasks done
vaughany opened this issue Feb 7, 2023 · 2 comments
Closed
3 tasks done
Labels
question Further information is requested

Comments

@vaughany
Copy link
Contributor

vaughany commented Feb 7, 2023

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

First time user of GolangCI-lint action.

In the .yml config file I wrote the following:

jobs:
  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v3
        with:
          go-version: 1.20

...which caused the action to download Go 1.2, not 1.20:

Run actions/setup-go@v3
  with:
    go-version: 1.[2](https://github.com/coachinabox/uptime-monitor/actions/runs/4116180025/jobs/7105883087#step:2:2)
    check-latest: false
    token: ***
    cache: false
Setup go version spec 1.2
Attempting to download 1.2...
matching 1.2...
Not found in manifest.  Falling back to download directly from Go
Install from dist
Acquiring go1.2.2 from https://storage.googleapis.com/golang/go1.2.2.linux-amd6[4](https://github.com/coachinabox/uptime-monitor/actions/runs/4116180025/jobs/7105883087#step:2:4).tar.gz
Extracting Go...
...

Changing go-version: 1.20 to go-version: 1.19 correctly uses Go 1.19.5.

Version of golangci-lint

latest (1.51.1 at the time of writing)

Version of the GitHub Action

3.4.0

Workflow file

name: golangci-lint
on:
  push:
    tags:
      - v*
    branches:
      - main
      - protobuf
  pull_request:
permissions:
  contents: read
  pull-requests: read
jobs:
  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v3
        with:
          go-version: 1.20
      - uses: actions/checkout@v3
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: latest
          # working-directory: somedir
          # args: --issues-exit-code=0
          only-new-issues: true
          # skip-cache: true
          # skip-pkg-cache: true
          # skip-build-cache: true

Go version

1.20

Code example or link to a public repository

// add your code here
@Loddan
Copy link

Loddan commented Feb 8, 2023

@vaughany Don't think this is a golangci-lint issue. See comment from the setup-go repo:

actions/setup-go#326 (comment)

[...] I think it is an expected behaviour. You need to specify version like this go-version: '1.20'. [...]

@vaughany
Copy link
Contributor Author

vaughany commented Feb 8, 2023

@Loddan You are correct. Thank you for pointing this out. I had searched through the issues but not on the 'setup-go' repository.

I can confirm that go-version: '1.20' does work as expected. Thank you!

@vaughany vaughany closed this as completed Feb 8, 2023
@ldez ldez added the question Further information is requested label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants