4 ms·
Oftentimes when I write in Go, I'll produce an unused variable as a side effect of commenting out code as a debugging experiment. What would you think about Go
by millstone 10y ago
Oftentimes when I write in Go, I'll produce an unused variable as a side effect of commenting out code as a debugging experiment. What would you think about Go issuing a warning instead of an error in this case?
Also, if goimports solves import issues, why isn't it just built into the compiler?
- tptacek 10y agoIt doesn't work as a language feature, because it's not precise or perfect. Package references can be ambiguous, and need to be overridden. It works extremely well as a tool though.
- xyproto 10y agoThis is a problem specifically about commenting in and out code. The IDE should comment in and out imports accordingly.