3 ms·
Can't you just write a debug function, that checks a variable, then either does nothing or calls fmt.Println? Set the variable from a command line parameter.
by btilly 14y ago
Can't you just write a debug function, that checks a variable, then either does nothing or calls fmt.Println? Set the variable from a command line parameter. Sprinkle debug statements everywhere you want, and flip the parameter as needed.
Since the import is always used, it is never an error. No problem.