File: example_test.go

package info (click to toggle)
golang-pretty 0.2.1%2Bgit20200831.59b4212-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 144 kB
  • sloc: makefile: 4
file content (20 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package pretty_test

import (
	"fmt"
	"github.com/kr/pretty"
)

func Example() {
	type myType struct {
		a, b int
	}
	var x = []myType{{1, 2}, {3, 4}, {5, 6}}
	fmt.Printf("%# v", pretty.Formatter(x))
	// output:
	// []pretty_test.myType{
	//     {a:1, b:2},
	//     {a:3, b:4},
	//     {a:5, b:6},
	// }
}