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

Hello Bar - Printf %v

  • Printf
  • %v

In some case it is better to use %v as it is type-agnostic. We're going to use it more often during the rest of these pages.

package main

import (
	"fmt"
)

func main() {
	name := "Bar"
	fmt.Printf("Hello %v\n", name)
}
Hello Bar