diff --git a/api/form.go b/api/form.go index 9b28484..4adc709 100644 --- a/api/form.go +++ b/api/form.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "mime" "net/http" "net/url" @@ -78,7 +77,7 @@ func PostForm(c httpClient, u string, params url.Values) (*FormResponse, error) switch mediaType { case "application/x-www-form-urlencoded": var bb []byte - bb, err = ioutil.ReadAll(resp.Body) + bb, err = io.ReadAll(resp.Body) if err != nil { return r, err } @@ -105,7 +104,7 @@ func PostForm(c httpClient, u string, params url.Values) (*FormResponse, error) } } default: - _, err = io.Copy(ioutil.Discard, resp.Body) + _, err = io.Copy(io.Discard, resp.Body) if err != nil { return r, err } diff --git a/api/form_test.go b/api/form_test.go index 78b669f..b6ca906 100644 --- a/api/form_test.go +++ b/api/form_test.go @@ -2,7 +2,7 @@ package api import ( "bytes" - "io/ioutil" + "io" "net/http" "net/url" "reflect" @@ -120,7 +120,7 @@ type apiClient struct { func (c *apiClient) PostForm(_ string, _ url.Values) (*http.Response, error) { c.postCount++ return &http.Response{ - Body: ioutil.NopCloser(bytes.NewBufferString(c.body)), + Body: io.NopCloser(bytes.NewBufferString(c.body)), Header: http.Header{ "Content-Type": {c.contentType}, }, diff --git a/device/device_flow_test.go b/device/device_flow_test.go index b7a0235..0616f08 100644 --- a/device/device_flow_test.go +++ b/device/device_flow_test.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "errors" - "io/ioutil" + "io" "net/http" "net/url" "reflect" @@ -37,7 +37,7 @@ func (c *apiClient) PostForm(u string, params url.Values) (*http.Response, error c.calls = append(c.calls, postArgs{url: u, params: params}) c.postCount++ return &http.Response{ - Body: ioutil.NopCloser(bytes.NewBufferString(stub.body)), + Body: io.NopCloser(bytes.NewBufferString(stub.body)), Header: http.Header{ "Content-Type": {stub.contentType}, }, diff --git a/go.mod b/go.mod index 374d30f..72c24ab 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/cli/oauth -go 1.13 +go 1.21 -require github.com/cli/browser v1.0.0 +require github.com/cli/browser v1.3.0 + +require golang.org/x/sys v0.13.0 // indirect diff --git a/go.sum b/go.sum index cb4bc70..c6840c0 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/cli/browser v1.0.0 h1:RIleZgXrhdiCVgFBSjtWwkLPUCWyhhhN5k5HGSBt1js= -github.com/cli/browser v1.0.0/go.mod h1:IEWkHYbLjkhtjwwWlwTHW2lGxeS5gezEQBMLTwDHf5Q= -github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI= -github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= +github.com/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo= +github.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/webapp/webapp_flow_test.go b/webapp/webapp_flow_test.go index 110ff0c..81dad43 100644 --- a/webapp/webapp_flow_test.go +++ b/webapp/webapp_flow_test.go @@ -3,7 +3,7 @@ package webapp import ( "bytes" "context" - "io/ioutil" + "io" "net" "net/http" "net/url" @@ -112,7 +112,7 @@ func (c *apiClient) PostForm(u string, params url.Values) (*http.Response, error c.calls = append(c.calls, postArgs{url: u, params: params}) c.postCount++ return &http.Response{ - Body: ioutil.NopCloser(bytes.NewBufferString(stub.body)), + Body: io.NopCloser(bytes.NewBufferString(stub.body)), Header: http.Header{ "Content-Type": {stub.contentType}, },