j5qllq
Last Updated: February 25, 2016
·
647
· murphyrandle

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. ~")

2 Responses
Add your response

10085

Just use fmt.Println :)

over 1 year ago ·
10087

That's a great point.

over 1 year ago ·