hey all I am trying to read the Response from http.Request like so:
func (ctr *Controller) Login(c *common.CPContext, req *http.Request, res http.ResponseWriter) (int, interface{}) { defer func() {
var code = req.Response.StatusCode; // invalid memory address or nil pointer dereference if code < 400 {
user.LoginAttempts = 0
} else {
user.LoginAttempts = user.LoginAttempts + 1
}
_, err := user.Update(ctx, db, boil.Infer())
if err != nil {
log.Warningf("could not save/update user model: %v", err)
} }()}