Last Updated: February 25, 2016
·
921
· 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

Just use fmt.Println :)

over 1 year ago ·

That's a great point.

over 1 year ago ·