Last active
April 4, 2019 20:08
-
-
Save grantseltzer/6180cb497c183db219303223252aadff 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
// This defeats the purpose of io.Writer | |
func WriteAsciiArtToFile(path string) error { | |
f, err := os.Open(path) | |
if err != nil { | |
return err | |
} | |
artBytes := makeSomeArt() | |
_, err = f.Write(artBytes) | |
return err | |
} | |
// Not an anti-pattern, idgaf what you do with my ascii art | |
func WriteAsciiArt(w io.Writer) (n int, error) { | |
artBytes := makeSomeArt() | |
return w.Write(artBytes) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment