-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflect error 2 #118
Labels
Comments
I've done some more investigation into this and I found a couple of issues that will be addressed in the next release. I'm currently working on fixes.
// struct is in a custom package
type SimpleRole struct {
sync.RWMutex
permissions []string
}
// .....
type Role struct {
*SimpleRole `db:"-"`
Id string `json:"id" db:"id" goqu:"skipinsert"`
Key string `json:"key" db:"key"`
Name string `json:"name" db:"name"`
CreatedAt time.Time `json:"-" db:"created_at" goqu:"skipinsert"`
}
Thank you for submitting this issue it pointed out quite use cases that should be handled. I hope to have a fix out in the next day or so. |
doug-martin
added a commit
that referenced
this issue
Aug 1, 2019
* [FIX] Fix reflection errors related to nil pointers and unexported fields #118 * Unexported fields are ignored when creating a columnMap * Nil embedded pointers will no longer cause a panic * Fields on nil embedded pointers will be ignored when creating update or insert statements. * [ADDED] You can now ingore embedded structs and their fields by using `db:"-"` tag on the embedded struct.
Merged
doug-martin
added a commit
that referenced
this issue
Aug 1, 2019
* [FIX] Fix reflection errors related to nil pointers and unexported fields #118 * Unexported fields are ignored when creating a columnMap * Nil embedded pointers will no longer cause a panic * Fields on nil embedded pointers will be ignored when creating update or insert statements. * [ADDED] You can now ingore embedded structs and their fields by using `db:"-"` tag on the embedded struct.
doug-martin
added a commit
that referenced
this issue
Aug 1, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error 1
panic: reflect: indirection through nil pointer to embedded struct
Error 2
reflect.Value.Interface: cannot return value obtained from unexported field or method.
and :
(reflect.Value.Interface: cannot return value obtained from unexported field or method)
The text was updated successfully, but these errors were encountered: