【Golang】Linters - goimports

Posted by 西维蜀黍 on 2021-07-28, Last Modified on 2021-11-13

With goimports, you can automatically update your Go import lines (add missing and remove unreferenced imports).

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.

  • goimports is a superset of gofmt which additionally adds (and removes) import lines as necessary.

Reference


TOC