News for hackers. Stuff that matters.
Re:I Love Go; I Hate Go by buro9 on Tuesday August 02, 2016 @02:57AM (#12208242)
> 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.

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.

Re:I Love Go; I Hate Go by zenlikethat on Tuesday August 02, 2016 @10:25AM (#12210151)
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.
Re:I Love Go; I Hate Go by donatj on Tuesday August 02, 2016 @10:08AM (#12210020)
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.
Re:I Love Go; I Hate Go by buro9 on Tuesday August 02, 2016 @10:29AM (#12210193)
"considers"?

It just finds a match and goes with it, and that does cause issue. Both of the above have potential security implications.

Filippo suggests preferring crypto/rand over math/rand as a softfix in this twitter conversation: https://twitter.com/filosottile/status/752210041709719552

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.