Skip to content

Instantly share code, notes, and snippets.

@smiley-yoyo
Created April 8, 2024 02:13
Show Gist options
  • Select an option

  • Save smiley-yoyo/8bcbde72fd90bd6d5ae1ea5e79c9ff5e to your computer and use it in GitHub Desktop.

Select an option

Save smiley-yoyo/8bcbde72fd90bd6d5ae1ea5e79c9ff5e to your computer and use it in GitHub Desktop.
How to build generics-aware goimports as of 2021/12/07
# In this script I'll use gotip, but there might be other ways
go install golang.org/dl/gotip@latest
# golang/go HEAD will be built
gotip download
# make sure gotip is available
gotip version
git clone https://github.com/golang/tools
cd tools
gotip install ./cmd/goimports/
# Now ~/go/bin/goimports (or somewhere else) can format Go code using generics!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment