Skip to content

Incorrect typecheck failure #408

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

Closed
jidicula opened this issue Feb 26, 2022 · 6 comments
Closed

Incorrect typecheck failure #408

jidicula opened this issue Feb 26, 2022 · 6 comments
Labels
question Further information is requested

Comments

@jidicula
Copy link

jidicula commented Feb 26, 2022

I'm seeing an incorrect failure of typecheck invoked by [email protected] in GitHub Actions: https://github.com/jidicula/vci-check/runs/5345676647?check_suite_focus=true#step:3:24

Specifically, it's throwing the error: Error: ReadAll not declared by package io (typecheck)

This is clearly incorrect, as io.ReadAll() indeed exists: https://pkg.go.dev/io#ReadAll . Perhaps it's parsing it incorrectly as a type exported by io rather than an exported function?

Running golangci-lint 1.44.2 locally on my machine does not throw this error.

@SVilgelm
Copy link
Member

SVilgelm commented Feb 26, 2022

Please read the README, the v3 does not install go anymore, you need to add:

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

@bewuethr
Copy link

bewuethr commented Mar 2, 2022

I see incorrect typecheck failures as well, but I do set up Go:

    steps:
      - name: Checkout repository
        uses: actions/[email protected]
        with:
          token: ${{ secrets.PAT_TOKEN }}

      - name: Setup Go
        uses: actions/[email protected]
        with:
          go-version: 1.17.7

      - name: Run golangci-lint
        # yamllint disable-line rule:line-length
        uses: golangci/golangci-lint-action@b517f99ae23d86ecc4c0dec08dcf48d2336abc29  # v3.1.0
        env:
          GOPRIVATE: github.com/myorg
        with:
          version: v1.44.2

@GiaoGiaoCat
Copy link

GiaoGiaoCat commented Apr 8, 2022

Here is my config and it fixed the problem.

name: golangci-lint
on:
  push:
    tags:
      - v*
    branches:
      - main

jobs:
  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - name: Setup Go
        uses: actions/[email protected]
        with:
          go-version: 1.17.8
          
      - uses: actions/checkout@v2
      
      - name: Check for unused Golang imports
        uses: Jerome1337/[email protected]
        
      - name: golangci-lint
        uses: golangci/[email protected]
        with:
          # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
          version: v1.45.2

          # Optional: working directory, useful for monorepos
          working-directory: ./be

          args: -v

@lonnblad
Copy link

I have this problem currently as well with this config:

  golangci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v3
        with:
          go-version: "1.19.2"
      - uses: actions/checkout@v3
      - name: golangci-lint
        uses: golangci/[email protected]
        with:
          version: v1.50

@lonnblad
Copy link

lonnblad commented Nov 2, 2022

My error was related to that a dependency to a private module didn't get downloaded correctly.
Really weird to get a typecheck-lint-error on this though.

@gabrieladumitrachioaiei
Copy link

For me the problem was the combination between the go version and the golangci-lint version. You can specifically set both to latest to see if that is the case.

@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

7 participants