func itReturnsNoError(t gobdd.StepTest, ctx context.Context) context.Context {
res, err := ctx.GetError(statsErrKey{})
if err != nil {
t.Error(err)
}
if res != nil {
t.Errorf("expected no error but %+v received", res)
}
return ctx
}
When I want to check if the GetError returns an error, sometimes I want to get nil from it. But, in such case the GetError will return the err as the second returned value. It should be nil as well.
Describe the bug
Here's sample code:
When I want to check if the
GetError
returns an error, sometimes I want to getnil
from it. But, in such case theGetError
will return theerr
as the second returned value. It should benil
as well.