1package pretty_test 2 3import ( 4 "fmt" 5 "github.com/kr/pretty" 6) 7 8func Example() { 9 type myType struct { 10 a, b int 11 } 12 var x = []myType{{1, 2}, {3, 4}, {5, 6}} 13 fmt.Printf("%# v", pretty.Formatter(x)) 14 // output: 15 // []pretty_test.myType{ 16 // {a:1, b:2}, 17 // {a:3, b:4}, 18 // {a:5, b:6}, 19 // } 20} 21