You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type ExoA struct {
ID int `storm:"increment"`
Foo int
}
type ExoB struct {
ID int `storm:"increment"`
Bar string
}
type Exercice interface {
// something here
}
func main() {
db, _ := storm.Open("test.db")
a := ExoA{1, 42}
b := ExoB{1, "yeah"}
db.Save(&a)
db.Save(&b)
ex := []Exercice{}
db.All(&ex)
fmt.Println(ex)
}
Currently, ex will be empty. It would make sense for it to contain elements a and b
The text was updated successfully, but these errors were encountered:
I'm afraid that's not possible because interfaces express behaviours not fields and Storm only cares about fields. There's no information about the type used to encode data in Storm, only raw data. Also, Storm uses the name of the struct to identify the right bucket to query.
It would be convenient to be able to do that:
Currently,
ex
will be empty. It would make sense for it to contain elementsa
andb
The text was updated successfully, but these errors were encountered: