Package present type in pretty and simple string.
go get github.com/backdround/go-typeprinterpackage main
import (
"fmt"
"github.com/backdround/go-typeprinter"
)
type Person struct {
name string
age int
work struct {
post string
floor int
}
}
func main() {
p := Person{
name: "bob",
age: 20,
work: struct {
post string
floor int
}{
post: "boss",
floor: 32,
},
}
fmt.Print(typeprinter.Sprint(p))
}Output:
Person {
name: "bob"
age: 20
work {
post: "boss"
floor: 32
}
}