Fmt Println number of returned bytes

Hello,

i’ve just started to learn go and the first function used is fmt.Println(). According to the documentation: “It returns the number of bytes written[…]”

Can you please explain me why i am receiving one extra byte?

https://play.golang.org/p/fGV5yqszcgm

Thank you

2 Likes

Println means the function prints a line: That includes the \n written at the end.

4 Likes

Ahh…my mistake.
// Spaces are always added between operands and a newline is appended.

2 Likes

Hi, @Coco_Petrut, can you mark this issue as resolved?

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.