j5qllq
Last Updated: February 25, 2016
·
622
· murphyrandle
621103 10151814410385600 1552271139 o

Put a newline at the end of your print statement!

While writing my first programs in golang, I realized that I constantly saw a % character appended to the end of my print statements.

Thanks to dominikh in #go-nuts I now know that the % character is ZSH's way of telling me that I've forgotten to append a \n to the print statement.

So:

fmt.Printf("~ Fin. ~\n")

Instead of:

fmt.Printf("~ Fin. ~")
Say Thanks
Respond

2 Responses
Add your response

10085
F7c8edd577d13b8930d5522f28123510

Just use fmt.Println :)

over 1 year ago ·
10087
621103 10151814410385600 1552271139 o

That's a great point.

over 1 year ago ·