good morning!!!!

Skip to content
Snippets Groups Projects
Commit f1277e52 authored by Paul Xue's avatar Paul Xue
Browse files

check and convert item pointer

parent 665dde14
No related branches found
No related tags found
No related merge requests found
...@@ -263,7 +263,8 @@ func (col *Collection) Exists() bool { ...@@ -263,7 +263,8 @@ func (col *Collection) Exists() bool {
// Fetches object _id or generates a new one if object doesn't have one or the one it has is invalid // Fetches object _id or generates a new one if object doesn't have one or the one it has is invalid
func getID(item interface{}) interface{} { func getID(item interface{}) interface{} {
v := reflect.ValueOf(item) v := reflect.ValueOf(item) // convert interface to Value
v = reflect.Indirect(v) // convert pointers
switch v.Kind() { switch v.Kind() {
case reflect.Map: case reflect.Map:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment