-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Seems like litter not accept costumed String() implement func
Example comparing go-spew
package main
import (
"github.com/davecgh/go-spew/spew"
"github.com/sanity-io/litter"
)
func main() {
TT()
}
type A struct {
Tag string
Num int
InA InA
}
type InA struct {
Id int
Type string
}
func (t InA) String() string {
return t.Type
}
func TT() {
a := A{
Tag: "tag-A",
Num: 1,
InA: InA{
Id: 100,
Type: "test",
},
}
spew.Dump(a)
litter.Dump(a)
}Output compare
(main.A) {
Tag: (string) (len=5) "tag-A",
Num: (int) 1,
InA: (main.InA) test
}
main.A{
Tag: "tag-A",
Num: 1,
InA: main.InA{
Id: 100,
Type: "test",
},
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels