Is there an open source JavaScript library that golang.org uses for Go Playgrounds? How does the Imports checkbox know which imports to add?
It uses the goimports
tool.
goimports
works as a direct replacement for gofmt
, with all the same options.