Единственный.
сделал как ты посоветовал:
type myEntry struct {
*ldap.Entry
Attributes []*myEntryAttribute
}
type myEntryAttribute struct {
*ldap.EntryAttribute
}
func (a *myEntryAttribute) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Name string
Values []string
}{Name: a.Name, Values: a.Values})
}
func ldapEntry2myEntry(t interface{}) interface{} {
switch e := t.(type) {
case []*ldap.Entry:
var res []interface{}
for _, v := range e {
res = append(res, ldapEntry2myEntry(v))
}
return res
case *ldap.Entry:
var att []*myEntryAttribute
for _, a := range e.Attributes {
att = append(att, &myEntryAttribute{a})
}
return &myEntry{e, att}
}
return nil
}