Open hnakamur opened 8 years ago
I noticed an error is ignored in (db Database) Col(name string) *Collection at https://github.com/diegogub/aranGO/blob/e183a93bbf438b18ae14245b7892acdd7dd3b107/database.go#L164
(db Database) Col(name string) *Collection
However if we change the signature to (db Database) Col(name string) (*Collection, error), it's harder to use.
(db Database) Col(name string) (*Collection, error)
So, how about adding (s *Session) Errors() []error? For example, gorm (which is an object-relational mapping library) has the following methods:
(s *Session) Errors() []error
@hnakamur good idea. I have to check other places too I guess.
I noticed an error is ignored in
(db Database) Col(name string) *Collection
at https://github.com/diegogub/aranGO/blob/e183a93bbf438b18ae14245b7892acdd7dd3b107/database.go#L164However if we change the signature to
(db Database) Col(name string) (*Collection, error)
, it's harder to use.So, how about adding
(s *Session) Errors() []error
? For example, gorm (which is an object-relational mapping library) has the following methods: