).
> >
> >
> > There is one point you need to remember when returning interfaces:
> > make sure you handle nil correctly:
> >
> > type S struct {}
> >
> > type I interface {}
> >
> > func f() *S {
> > return nil
> > }
> >
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
"gol
rote:
> On Thu, Sep 26, 2019 at 1:14 PM Martin Palma wrote:
> >
> > Hello,
> >
> > I'm in the process of writing an HTTP API with Go. I use a middleware
> for generating and validating JWT tokens. On any incoming request the
> middleware checks the JWT and v
Hello,
I'm in the process of writing an HTTP API with Go. I use a middleware for
generating and validating JWT tokens. On any incoming request the
middleware checks the JWT and validates it. If valid it adds it to the
request header and calls the next handler.
Is it save to use the JWT in the