3 ms·
As someone who has moved to using Go whenever it is possible and reasonably appropriate, I don't find this a particularly large problem. Yes, it's one I encoun
by tshadwell 14y ago
As someone who has moved to using Go whenever it is possible and reasonably appropriate, I don't find this a particularly large problem.
Yes, it's one I encounter, but only once the package is finished and I am in the testing stage and need to debug. Then, the fmt import stays there until I'm done fixing bugs, and I just use gocode's `:Drop fmt` to drop the import. Syntastic, which is a brilliant code validator for vim uses the go compiler to point out every place I have placed an fmt.Println with >>>, allowing me to remove all of them in one fell swoop, where in other languages I would have to search through the code for various print statements. The vanilla Go compiler also points this out, as the author notes.
I prefer the way the compiler works because it makes sure your code is always representative of what needs to, and happens.
To the author I would say "Why comment out the fmt.Println if you are still debugging?" and "If you are debugging, why only one fmt.Println?".