You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where go files generating from paths that looks like internal/snippet/some{{ .Metadata.Name }}/packageName/something.go. I process them with golang template engine, so in a final project it's ok)
I've set option to exclude-dirs in config.
The problem here is that folders actually are not skipped.
I see error like: typechecking error: malformed import path "...some{{.Metadata.Name}}": invalid char '{'
The question is is this a bug or if I need to template something I should use .tmpl files instead of .go? But what about to skip directories completely?
Version of golangci-lint
$ golangci-lint --versiongolangci-lint has version 1.57.2 built with go1.22.1 from 77a8601 on 2024-03-28T18:39:06Z
Configuration
issues:
exclude-dirs:
- internal/snippet
Go environment
$ go version && go envgo version go1.21.6 darwin/amd64GO111MODULE='auto'GOARCH='amd64'GOBIN=''GOEXE=''GOEXPERIMENT=''GOFLAGS=''GOHOSTARCH='amd64'GOHOSTOS='darwin'GOINSECURE=''GOOS='darwin'GOPROXY='direct'GOSUMDB='off'GOTMPDIR=''GOTOOLCHAIN='auto'GOVCS=''GOVERSION='go1.21.6'GCCGO='gccgo'GOAMD64='v1'AR='ar'CC='clang'CXX='clang++'CGO_ENABLED='1'GOWORK=''CGO_CFLAGS='-O2 -g'CGO_CPPFLAGS=''CGO_CXXFLAGS='-O2 -g'CGO_FFLAGS='-O2 -g'CGO_LDFLAGS='-O2 -g'PKG_CONFIG='pkg-config'
There is no possible fix because it's related to the Go tooling.
The loading of packages (by the official Go tooling) doesn't behave exactly like go build: file paths don't follow the same validations.
I recommend using the .tmpl extension.
FYI exclude-dirs is a post-process filter on reports, currently the Go tooling doesn't offer the possibility to ignore a package or a file during the analysis. We renamed and movedrun.skip-dirs to issues.exclude-dirs to avoid confusion about this option.
Welcome
Description of the problem
I have a project where go files generating from paths that looks like
internal/snippet/some{{ .Metadata.Name }}/packageName/something.go
. I process them with golang template engine, so in a final project it's ok)I've set option to exclude-dirs in config.
The problem here is that folders actually are not skipped.
I see error like:
typechecking error: malformed import path "...some{{.Metadata.Name}}": invalid char '{'
The question is is this a bug or if I need to template something I should use
.tmpl
files instead of.go
? But what about to skip directories completely?Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
The text was updated successfully, but these errors were encountered: