goimports
Update Go import lines, adding missing ones and removing unreferenced ones. More information: https://pkg.go.dev/golang.org/x/tools/cmd/goimports.
- Display the completed import source file:
goimports
- Write the result back to the source file instead of
stdout:
goimports -w
- Display diffs and write the result back to the source file:
goimports -w -d
- Set the import prefix string after 3rd-party packages (comma-separated list):
goimports -local
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
