reported by @ivanjaros in #72860 (comment)
I just updated my Go version to 1.25 and I immediately got compilation error for the following code - which is correct and should compile, but this new change makes it fail:
func RetrieveOauthCodeGrantHandler(ctx context.Context, req RetrieveOauthCodeGrantRequest) (res *RetrieveOauthCodeGrantResponse, err error) {
errOut := func(errType, info string) {
res = &RetrieveOauthCodeGrantResponse{
Failure: &RetrieveOauthCodeGrantResponse_Failure{
Error: errType,
ErrorDescription: info,
ErrorURI: "",
},
}
err = nil
}
if err := req.Validate(); err != nil {
errOut("invalid_request", errors.String(err))
return
}
...
}
I had to rename the variable to e:
if e := req.Validate(); e != nil {
errOut("invalid_request", errors.String(e))
return
}
I think this change has not been implemented correctly if this is not compiling. I usually don't write my code like this but this is a special case where it had to be done like this and i caught it right away by accident(as I usually don't write code like this).
reported by @ivanjaros in #72860 (comment)
I just updated my Go version to 1.25 and I immediately got compilation error for the following code - which is correct and should compile, but this new change makes it fail:
I had to rename the variable to
e:I think this change has not been implemented correctly if this is not compiling. I usually don't write my code like this but this is a special case where it had to be done like this and i caught it right away by accident(as I usually don't write code like this).