Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions api/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"mime"
"net/http"
"net/url"
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions api/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package api

import (
"bytes"
"io/ioutil"
"io"
"net/http"
"net/url"
"reflect"
Expand Down Expand Up @@ -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},
},
Expand Down
4 changes: 2 additions & 2 deletions device/device_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"context"
"errors"
"io/ioutil"
"io"
"net/http"
"net/url"
"reflect"
Expand Down Expand Up @@ -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},
},
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
4 changes: 2 additions & 2 deletions webapp/webapp_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package webapp
import (
"bytes"
"context"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -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},
},
Expand Down
Loading