I always find accept interface and return struct to be very useful. It
makes the code more cleaner.



On Wed, 9 Oct 2019 at 9:40 AM, Martin Palma <m...@palma.bz> wrote:

> I'm wondering If it is ok (or good Go code) if an interface method returns
> an other interface? Here an example:
>
> type Querier interface {
>  Query() string
> }
>
> type Decoder interface {
>  DecodeAndValidate() Querier
> }
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/531f29a6-ea2e-4416-a0d0-ce697dc7a09b%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/531f29a6-ea2e-4416-a0d0-ce697dc7a09b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wF00OXq0-CDR76rcF8_O%2Bs94oTRawFLP_VUoLH-RfiacQ%40mail.gmail.com.

Reply via email to