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

Print to STDERR or STDOUT

  • STDERR
  • STDOUT
  • Stderr
  • WriteString
  • Fprintln
package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println("To STDOUT using fmt.Println")
	fmt.Fprintln(os.Stderr, "To STDERR using fmt.Fprintlt")
	os.Stderr.WriteString("To STDERR using os.Stderr.WriteString\n")
}