Created
November 26, 2018 12:22
-
-
Save jreisinger/2c178ce37e9ac9012d75cdbb3d1581ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) | |
var output = make(map[io.Writer]bool) | |
func main() { | |
output[os.Stdout] = true | |
output[os.Stderr] = false | |
for w, enabled := range output { | |
if enabled { | |
fmt.Fprintf(w, "Some output\n") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment