I am looking for a lib or snippet that allows to (pretty) print not the content of a struct instance but its structure. Heres a some code and the expected output:
package main
import "fantastic/structpp"
type Foo struct {
Bar string
Other int
}
func main() {
i := Foo{Bar: "This", Other: 1}
str := structpp.Sprint{i}
fmt.Println(str)
}
would print (this or similar):
Foo struct {
Bar string
Other int
}
Note that I am aware of github.com/davecgh/go-spew/spew
but I don't want to prettyprint the data, I only need the definition of the struct.