Having an unused import is a compilation error so it's generally good that editors do this (by calling goimports or using the gopls code action). Using the underscore notation is a good tip though.
On Wednesday, 19 November 2025 at 09:18:31 UTC Brian Candler wrote: > I don't know anything about fancy editors, but I note that go.dev/play/ > does the same (maybe for same underlying reason). > > You can prevent it by writing: > > import _ "github.com/zalando/go-keyring" > > (although you then have to remove the underscore later when you actually > want to use the module) > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/a61f086c-8a54-465d-80a6-cbe59b77afa7n%40googlegroups.com.
