Closed bsr203 closed 10 years ago
It looks to me like the map is nil. If the table is not returned, then the *TableMap
returned is nil and not safe to use (this is kind of bad, by the way; this function should probably return (*TableMap, error).. but that's a breaking change and another discussion).
Your error comes from having a nil DbMap, eg:
type mytable struct{}
myt := mytable{}
var db *DbMap
db.TableForType(reflect.TypeOf(myt)) // m will be nil, so m.tables panics on 389
As far as I see, any operation results in a panic if the table is not added to dbmap. But, it should either give a clear error about which table is missing, or instead return an error.
stack indicates this line in the code.
stack: