Then looking at this code:
res, err := client.Do(req)
defer res.Body.Close()
if err != nil {
return nil, err
}
I'm guessing that err
is not nil
. You're accessing the .Close()
method on res.Body
before you check for the err
.
The defer
only defers the function call. The field and method are accessed immediately.
So instead, try checking the error immediately.
res, err := client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
- error dereference address invalid runtimeerror dereference address invalid dereference address pointer virtual vue_error_runtime git-error invalid error path sign_date invalid default error vue_error_runtime non-element directives component git invalid项目error invalid esbuild config error nginx invalid number error developer invalid active error