Fix pointer handling in inmem nextID (#323)

This commit is contained in:
Zachary Wasserman 2016-10-17 13:11:23 -04:00 committed by Mike Arpaia
parent e38dd40699
commit 05cb15d63c

View file

@ -90,7 +90,7 @@ func sortResults(slice interface{}, opt kolide.ListOptions, fields map[string]st
// nextID returns the next ID value that should be used for a struct of the
// given type
func (orm *inmem) nextID(val interface{}) uint {
valType := reflect.TypeOf(val)
valType := reflect.TypeOf(reflect.Indirect(reflect.ValueOf(val)).Interface())
orm.nextIDs[valType]++
return orm.nextIDs[valType]
}