View Code? Open in Web Editor
NEW
Golang library to act on structure fields at runtime. Similar to Python getattr(), setattr(), hasattr() APIs.
Home Page: https://pkg.go.dev/github.com/ssrathi/go-attr
License: MIT License
go-attr's People
Contributors
go-attr's Issues
Need to add support to handle embedded fields in a struct recursively.
Code at line 103:
if fieldValue.Type() != reflect.TypeOf(newValue) {
return ErrMismatchValue
}
This code fails if fieldValue.Type() is an interface, and newValue is a struct/pointer to struct implementing that interface