http.NoBody
instead of nil
in http.NewRequest
calls GO-R4001241 url := fmt.Sprintf("http://%s.fly.dev/flyio/v1/settings", app.Name)
242 // url := fmt.Sprintf("http://%s.fly.dev/flyio/v1/prune?since='12h'", app.Name)
243
244 req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)245 if err != nil {
246 tracing.RecordError(span, err, "failed to create remote builder request")
247 return nil, err
http.NoBody
is an io.ReadCloser
with no bytes. Read always returns EOF
and
Close
always returns nil
.
func foo(url string) {
http.NewRequest("GET", url, nil)
}
func foo(url string) {
http.NewRequest("GET", url, http.NoBody)
}