github.com/aarzilli/tools@v0.0.0-20151123112009-0d27094f75e0/net/http/domclean2/funcs_pf.go (about) 1 package domclean2 2 3 import "fmt" 4 5 var pf func(format string, a ...interface{}) (int, error) = fmt.Printf 6 var pfRestore func(format string, a ...interface{}) (int, error) = fmt.Printf 7 8 var spf func(format string, a ...interface{}) string = fmt.Sprintf 9 var wpf = fmt.Fprintf 10 11 // type pft func(format string, a ...interface{}) (int, error) 12 13 func pfDevNull(format string, a ...interface{}) (int, error) { 14 return 0, nil // sucking void 15 } 16 17 // Disable all printing 18 // within a function and callees: 19 func exampleUsage() { 20 pf = pfDevNull 21 defer func() { pf = pfRestore }() 22 }