I would like to implement a some shared functionality across models. For example, a method that looks for one result but does not error if the one result is not found.
The issue with this is pg doesn't know the model type so I get a panicpg: Model(unsupported interface {}). I realize this may be a go limitation but wondering if anyone has a suggestion for implementing this or another way of looking at it. I'd probably rather just have the dupe code than build the query myself which I realize is an alternative.
I would like to implement a some shared functionality across models. For example, a method that looks for one result but does not error if the one result is not found.
The issue with this is pg doesn't know the model type so I get a panic
pg: Model(unsupported interface {})
. I realize this may be a go limitation but wondering if anyone has a suggestion for implementing this or another way of looking at it. I'd probably rather just have the dupe code than build the query myself which I realize is an alternative.