4 ms·
When debugging, add the package-level statement var _ = fmt.Println to avoid unused errors. Here's an example: http://play.golang.org/p/cZtmILYWoZ http://play.g
by BarkMore 14y ago
When debugging, add the package-level statement var _ = fmt.Println to avoid unused errors. Here's an example: http://play.golang.org/p/cZtmILYWoZ http://play.golang.org/p/cZtmILYWoZ
- melvinmt 14y agoEven easier: just add _ before you import: import ( _ "fmt" ) To prevent the unused var error you can assign the var to an _ as well: _ = unusedVar
- sltkr 14y ago> Even easier: just add _ before you import How is that an improvement? That's just as much work as commenting the line out.