Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Newlines

package main

import (
	"fmt"
)

func main() {
	a := "\n"
	b := '\n'
	fmt.Printf("string: '%v'\n", a)
	fmt.Printf("rune: '%v'\n", b) // 10

	c := "\r"
	d := '\r'
	fmt.Printf("string: '%v'\n", c)
	fmt.Printf("rune: '%v'\n", d) // 13
}
string: '
'
rune: '10'
string: '
'
rune: '13'