On Monday, May 8, 2017 at 8:28:45 PM UTC-4, Kevin Malachowski wrote:
>
> You can declare a func "print" in each package which just calls the real 
> print func. When you want to turn off printing, you just have one line to 
> comment out in that func to affect all callers.


Thanks
 

> I'm curious why fmt.Printf doesn't work for you, though. In that case 
> you'd still probably want a way to turn off that specific output, but I'm 
> still curious.
>

Oh, nothing, just being lazy to have fewer thing to type. It started with 
two `print`s, then because the code is not working as I expected, so before 
I know, the prints are all over the places now -- unplanned. 

I thought I could easily wrap those `print`s into:

func debug(args ...interface{}) {
print(args...)
}

but only after doing that did I realize that I was wrong. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to