Fundamentals7 / 10
Up next

Printf verbs

package main

import "fmt"

func main() {
	name := "Go"
	pi := 3.14159
	// %s string, %d integer, %.2f float, %v any value
	fmt.Printf("%s: %d %.2f\n", name, 42, pi)
	// %T prints the value's type
	fmt.Printf("%T\n", pi)
}
What you're solving

format with %d %s %.2f %v %T