Fmt Println number of returned bytes


(Coco Petrut) #1

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


(Sandertv) #2

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


(Coco Petrut) #3

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


(Sean Killian) #4

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