Comments (6)
Running a go build
or just go mod download
before linting does appear to fix the issue for me.
from golangci-lint-action.
Have you read Why do you have typecheck
errors?
typecheck
is not a real linter but golangci-lint
's way of presenting compilation/module/run errors.
What happens if you try to compile your code before the linting step with go build ./...
?
from golangci-lint-action.
Yes, I read the notes about typecheck and followed the instructions there but it didn't help.
I think I've narrowed down the issue. I'm seeing the same issue sometimes with v1.54.2, so it doesn't seem to be related to the 1.55 upgrade. However, in all the failures, it looks like the setup-go action is not finding local cache.
Run actions/setup-go@v4
with:
go-version: 1.21
check-latest: false
token: ***
cache: true
Setup go version spec 1.21
Found in cache @ /opt/hostedtoolcache/go/1.21.3/x64
Added go to the path
Successfully set up Go version 1.21
/opt/hostedtoolcache/go/1.21.3/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.21.3/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Cache is not found
go version go1.21.3 linux/amd64
Whereas with the successful runs, setup-go finds the local cache.
/home/runner/.cache/go-build
Received 134217728 of 511766649 (26.2%), 126.9 MBs/sec
Received 335544320 of 511766649 (65.6%), 159.0 MBs/sec
Received 511766649 of 511766649 (100.0%), 164.9 MBs/sec
Cache Size: ~488 MB (511766649 B)
/usr/bin/tar -xf /home/runner/work/_temp/c2939fd8-9587-42a2-81aa-4e1750096bad/cache.tzst -P -C /home/runner/work/bellburnell/bellburnell --use-compress-program unzstd
Cache restored successfully
Cache restored from key: setup-go-Linux-ubuntu22-go-1.21.3-e3e0a5df9b4329f309a1660fef499b27d262892d31bfd97eec3382ce8fa9124b
I didn't think it would be necessary to run a go build
before the lint but I can try it.
from golangci-lint-action.
I didn't think it would be necessary to run a go build before the lint but I can try it.
Sorry, I misread parts of your ticket and didn't realize it worked by just retrying. It's so common with these typecheck
issues that I didn't read your ticket properly.
go build
is not required, I was mostly curious what output it would give since typecheck
isn't always the best way to present these issues.
from golangci-lint-action.
I'm having a similar issue.
When running something like this:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
I get typecheck failures. When I added a go build
before the lint, it worked, and now if I use:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: go mod download
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
skip-pkg-cache: true
It works.
@pgier Did you find a different solution?
from golangci-lint-action.
@ohad83 looks like you didn't have to run a full go build
just a go mod download
is that correct?
I didn't find a different solution, I was trying to avoid a full build every time before linting just to reduce the CI feedback loop. I tried changing various caching options without success. It's a bit hard to test because the issue is intermittent for me.
from golangci-lint-action.
Related Issues (20)
- Caching of the linting data causing timeout.
- Add skip-dir support HOT 1
- golangci-lint is failing with go version 1.20 HOT 4
- make it possible to set the GOOS / GOARCH HOT 4
- The linter does not print line number nor filename HOT 8
- Action failed in [email protected] HOT 3
- Issue running golangci-lint 1.53 via the action HOT 1
- Github Actions lint failures on 1.53.0 HOT 5
- Remove dependabot entries from changelog HOT 2
- stale caches -- any way to avoid or flush? HOT 4
- typecheck error is not resulting in useful annotation HOT 2
- annotations display on 2 PR (develop and staging, although I don't run golangci-lint in staging) HOT 1
- "File exists" errors when un-taring golangci-lint on upgrading to setup-go@v4 from setup-go@v3 HOT 4
- lint failures do not report which file or line failed HOT 4
- Add support for `new-from-rev` HOT 3
- bug: The file exists in scripts/golangci.yml, but it still gives an error HOT 1
- buildir: failed to load package pebble: could not load export data: no export data for "github.com/ethereum/go-ethereum/ethdb/pebble"
- caches: Do we really need them anymore? The current implementation conflicts with automatic caching in latest `setup-go`. HOT 4
- Incompatibility with go 1.21 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from golangci-lint-action.