[Golang] Print

Tags
Golang
Engineering
Created
Nov 7, 2023 04:56 AM
Edited
Nov 6, 2023
Description

Printing

  • Print the same outputs
fmt.Printf("Hello %d\n", 23)
fmt.Fprint(os.Stdout, "Hello ", 23, "\n")
fmt.Println("Hello", 23)
fmt.Println(fmt.Sprint("Hello ", 23))
  • Mostly
    • %d: digit
    • %s: string
    • %v: all values (powerful)
    • %T: the type of the value

Source