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
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
The interactions between vscode-go's auto-import feature, goimports formatting, and formatOnSave seem often to result in a poorly formatted import block. I'm not sure whether this is a misconfiguration on my part, or a true bug, but it's something I hit frequently and I would love to know of a solution for it.
Steps to reproduce:
Create and save a file that references a standard library package.
The auto-complete import added the third package (bytes in this case) to the bottom of the import list, and that caused goimports to leave a newline between it and fmt. The result is that the standard library imports are not grouped together and not sorted correctly. Over time, during active development, this problem magnifies and the import block can have a half-dozen newline-separate groups, alternating between standard and external libraries, rather than having things grouped and sorted correctly.
What can be done to avoid this and get the expected grouping and sorting?
package problem
import (
"bytes"
"fmt"
"github.com/garyburd/redigo/redis"
)
The text was updated successfully, but these errors were encountered:
The interactions between vscode-go's auto-import feature,
goimports
formatting, and formatOnSave seem often to result in a poorly formatted import block. I'm not sure whether this is a misconfiguration on my part, or a true bug, but it's something I hit frequently and I would love to know of a solution for it.Steps to reproduce:
The auto-complete import added the third package (
bytes
in this case) to the bottom of the import list, and that causedgoimports
to leave a newline between it andfmt
. The result is that the standard library imports are not grouped together and not sorted correctly. Over time, during active development, this problem magnifies and the import block can have a half-dozen newline-separate groups, alternating between standard and external libraries, rather than having things grouped and sorted correctly.What can be done to avoid this and get the expected grouping and sorting?
The text was updated successfully, but these errors were encountered: