2015-05-25 02:00:21 +00:00
|
|
|
package pretty_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2016-03-01 00:51:26 +00:00
|
|
|
"github.com/kr/pretty"
|
2015-05-25 02:00:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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},
|
|
|
|
// }
|
|
|
|
}
|