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
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.7
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
What did you do?
Import using the vendor folder. I used the github.com/lib/pq library. In my code, it only references postgres in the datasource name. If I don't use _ github.com/lib/pq/library in the imports section, goimports deletes the import line for it. I don't want to have to use the _ preface.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered:
This is WAI. goimports only preserves the import lines that are used by the rest of the file; if you want to keep an import despite not using it, you need to import it as _ (this is called a blank import). See https://golang.org/doc/effective_go.html#blank_import
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.7
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
What did you do?
Import using the vendor folder. I used the github.com/lib/pq library. In my code, it only references postgres in the datasource name. If I don't use _ github.com/lib/pq/library in the imports section, goimports deletes the import line for it. I don't want to have to use the _ preface.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: