Closed nhaancs closed 2 months ago
That method is implementing an interface where the return value can be any concrete value that implements the interface. We do this in the web package as well with the Encoder interface.
there are times where your API represents behavior that must be open to different concrete types because you will have unknown implementations.
https://github.com/ardanlabs/service/blob/f522e6646ac4836aabf29cea237baefdba23b720/business/domain/userbus/stores/userdb/userdb.go#L36C1-L37C1
func (s *Store) NewWithTx(tx sqldb.CommitRollbacker) (userbus.Storer, error) {