Closed MistaTwista closed 6 months ago
Hello,
can you provide a minimal reproducible example?
yes, sure, sorry https://github.com/MistaTwista/templado
looks similar at some things https://github.com/golangci/golangci-lint/issues/1832
btw, i can look for fix if you don't mind
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 moved run.skip-dirs
to issues.exclude-dirs
to avoid confusion about this option.
Closes in favor of #4360 - Feel free to subscribe there for updates.
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