-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
When dumping a struct that has a private field containing a map litter panics because the map key sort function calls .Interface() on an unexported value.
Repro case:
package main
import (
"github.com/sanity-io/litter"
)
type privateMap struct {
private map[string]map[string]bool
}
func main() {
litter.Options{
HidePrivateFields: false,
StripPackageNames: true,
}.Dump(&privateMap{
private: map[string]map[string]bool{
"panics": {
"panics": true,
},
"test": {
"test": true,
},
},
})
}Results in error:
&privateMap{
private: map[string]map[string]bool{
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
With the stack trace attributing this panic to dump.go:392
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels