unexpected-go icon indicating copy to clipboard operation
unexpected-go copied to clipboard

Write about positional fmt arguments

Open colega opened this issue 2 years ago • 0 comments

See example:

package main

import (
	"fmt"
)

func main() {
	fmt.Printf("%v, %[1]v, %v, %[1]v, %v\n", 1, 2, 3, 4, 5)
	fmt.Printf("%v, %[1]v, %v, %[3]v, %v\n", 1, 2, 3, 4, 5)
	fmt.Printf("%v, %[5]v, %v, %[3]v, %v\n", 1, 2, 3, 4, 5)
	fmt.Printf("%v, %[1]v, %v, %[2]v, %v\n", 1, 2, 3, 4, 5)
}

colega avatar Jan 03 '23 08:01 colega