> I get the sense that most Go programmers use "goimports" to work around the annoyance. I have my Emacs configured to use it automatically. I never even think about imports anymore.
The minor inconvenience of occasionally having to fix a path when goimports picked the wrong one is far outweighed by the massive convenience it brings me every day.
I have been using it since I switched to VSCode about 4 months ago and thus far, knock on wood, it's always found the one I intend. I however do think it considers what public members/methods you are calling.
I'd probably prefer html/template over text/template as it's better to have someone ask why their output was HTML escaped than to have someone render HTML in plain text without explicitly wanting to do so.
You haven't yet encountered clashing names?
https://golang.org/pkg/crypto/rand/
https://golang.org/pkg/math/rand/
Or?
https://golang.org/pkg/text/template/
https://golang.org/pkg/html/template/
goimports is wonderful, but some care is needed to make sure it has added the one you intended to add.
NB: Only an issue when new imports are added, not an issue if the correct package is already referenced.