florence pugg

Wed, 06 May 2026 09:44:17 +0000

Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones. Basic usage Adding a tool to a project is nearly the same as a standard runtime dependency, with the additional -tool flag: $ goimports # I don't have goimports yet! zsh: command. // The goimports on-save hook writes the buffer to a temp file // first and runs goimports before the actual save to newfile.go. In addition to fixing imports, goimports also formats your code in the same style as gofmt so it can be used as a replacement for your editor's gofmt-on-save hook.