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

x/lint: go:embed gives false positives about comment format #44354

Closed
howardjohn opened this issue Feb 17, 2021 · 2 comments
Closed

x/lint: go:embed gives false positives about comment format #44354

howardjohn opened this issue Feb 17, 2021 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@howardjohn
Copy link
Contributor

Source:

var (
        //go:embed charts/* profiles/*
        //go:embed charts/gateways/istio-egress/templates/_affinity.tpl
        //go:embed charts/gateways/istio-egress/templates/_helpers.tpl
        //go:embed charts/gateways/istio-ingress/templates/_affinity.tpl
        FS embed.FS
)

Execution:

$ go version
go version go1.16 linux/amd64
$ go install golang.org/x/lint/golint@master
$ golint ./manifests/...
manifests/manifest.go:24:2: comment on exported var FS should be of the form "FS ..."

I would expect this to not require a comment starting with FS since I am not trying to write a comment with go:embed, but rather compiler instructions.

@cespare cespare changed the title go:embed gives false positives about comment format x/lint: go:embed gives false positives about comment format Feb 17, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 17, 2021
@cespare
Copy link
Contributor

cespare commented Feb 17, 2021

(Updated the title to be about lint.)

That's definitely a bug, but also x/lint is really not maintained and will probably be deprecated. See #38968.

@toothrot toothrot added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 18, 2021
@mvdan
Copy link
Member

mvdan commented May 8, 2021

Thank you for submitting this issue! As per #38968, we are freezing and deprecating golint. There's no drop-in replacement to golint per se, but you should find that Staticcheck works well in encouraging good Go code, much like golint did in the past, since it also includes style checks. There's always gofmt and go vet too, of course.

If you would like to contribute further, I'd encourage you to engage Staticcheck's issue tracker or look at vet's open issues, as they are both actively maintained. If you have an idea that doesn't fit into either of those tools, you could look at other Go linters, or write your own - these days it's fairly straightforward with go/analysis.

To help avoid confusion, I'm closing all golint before we freeze its repository. If you have any feedback, you can leave a comment on the proposal thread where it was decided to deprecate golint - though note that the proposal has been accepted for nearly a year. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants