Created
September 13, 2017 01:28
-
-
Save vladimirvivien/6bcea49bf1f2a931e626f1fe84ec715e to your computer and use it in GitHub Desktop.
This file contains 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
func main() { | |
proverbs := []string{ | |
"Channels orchestrate mutexes serialize", | |
"Cgo is not Go", | |
"Errors are values", | |
"Don't panic", | |
} | |
var writer bytes.Buffer | |
for _, p := range proverbs { | |
n, err := writer.Write([]byte(p)) | |
if err != nil { | |
fmt.Println(err) | |
os.Exit(1) | |
} | |
if n != len(p) { | |
fmt.Println("failed to write data") | |
os.Exit(1) | |
} | |
} | |
fmt.Println(writer.String()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment