diff options
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/github/config.go | 8 | ||||
-rw-r--r-- | bridge/github/export.go | 6 | ||||
-rw-r--r-- | bridge/jira/client.go | 36 |
3 files changed, 25 insertions, 25 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go index 2f5d1f3b..9ae1d187 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "regexp" @@ -233,7 +233,7 @@ func requestUserVerificationCode(scope string) (*githRespT, error) { return nil, fmt.Errorf("unexpected response status code %d from Github API", resp.StatusCode) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.Wrap(err, "error requesting user verification code") } @@ -284,7 +284,7 @@ func pollGithubForAuthorization(deviceCode string, intervalSec int64) (string, e return "", fmt.Errorf("unexpected response status code %d from Github API", resp.StatusCode) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { _ = resp.Body.Close() return "", errors.Wrap(err, "error polling the Github API") @@ -490,7 +490,7 @@ func validateUsername(username string) (bool, string, error) { return false, "", nil } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return false, "", err } diff --git a/bridge/github/export.go b/bridge/github/export.go index 0d340b49..30e064c0 100644 --- a/bridge/github/export.go +++ b/bridge/github/export.go @@ -5,7 +5,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "os" "strings" @@ -452,7 +452,7 @@ func getRepositoryNodeID(ctx context.Context, token *auth.Token, owner, project NodeID string `json:"node_id"` }{} - data, _ := ioutil.ReadAll(resp.Body) + data, _ := io.ReadAll(resp.Body) err = resp.Body.Close() if err != nil { return "", err @@ -564,7 +564,7 @@ func (ge *githubExporter) createGithubLabel(ctx context.Context, label, color st Color string `json:"color"` }{} - data, _ = ioutil.ReadAll(resp.Body) + data, _ = io.ReadAll(resp.Body) defer resp.Body.Close() err = json.Unmarshal(data, &aux) diff --git a/bridge/jira/client.go b/bridge/jira/client.go index 0e4e561f..3ceffff2 100644 --- a/bridge/jira/client.go +++ b/bridge/jira/client.go @@ -6,7 +6,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/http/cookiejar" "net/url" @@ -421,12 +421,12 @@ func (client *Client) RefreshSessionTokenRaw(credentialsJSON []byte) error { defer response.Body.Close() if response.StatusCode != http.StatusOK { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) return fmt.Errorf( "error creating token %v: %s", response.StatusCode, content) } - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) var aux SessionResponse err = json.Unmarshal(data, &aux) if err != nil { @@ -495,7 +495,7 @@ func (client *Client) Search(jql string, maxResults int, startAt int) (*SearchRe var message SearchResult - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &message) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -623,7 +623,7 @@ func (client *Client) GetIssue(idOrKey string, fields []string, expand []string, var issue Issue - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &issue) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -677,7 +677,7 @@ func (client *Client) GetComments(idOrKey string, maxResults int, startAt int) ( var comments CommentPage - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &comments) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -819,7 +819,7 @@ func (client *Client) GetChangeLog(idOrKey string, maxResults int, startAt int) var changelog ChangeLogPage - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &changelog) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -937,7 +937,7 @@ func (client *Client) GetProject(projectIDOrKey string) (*Project, error) { var project Project - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &project) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -996,7 +996,7 @@ func (client *Client) CreateIssue(projectIDOrKey, title, body string, defer response.Body.Close() if response.StatusCode != http.StatusCreated { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) err := fmt.Errorf( "HTTP response %d, query was %s\n data: %s\n response: %s", response.StatusCode, request.URL.String(), data, content) @@ -1005,7 +1005,7 @@ func (client *Client) CreateIssue(projectIDOrKey, title, body string, var result IssueCreateResult - data, _ = ioutil.ReadAll(response.Body) + data, _ = io.ReadAll(response.Body) err = json.Unmarshal(data, &result) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -1048,7 +1048,7 @@ func (client *Client) UpdateIssueTitle(issueKeyOrID, title string) (time.Time, e defer response.Body.Close() if response.StatusCode != http.StatusNoContent { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) err := fmt.Errorf( "HTTP response %d, query was %s\n data: %s\n response: %s", response.StatusCode, request.URL.String(), data, content) @@ -1108,7 +1108,7 @@ func (client *Client) UpdateIssueBody(issueKeyOrID, body string) (time.Time, err defer response.Body.Close() if response.StatusCode != http.StatusNoContent { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) err := fmt.Errorf( "HTTP response %d, query was %s\n data: %s\n response: %s", response.StatusCode, request.URL.String(), data, content) @@ -1160,7 +1160,7 @@ func (client *Client) AddComment(issueKeyOrID, body string) (*Comment, error) { defer response.Body.Close() if response.StatusCode != http.StatusCreated { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) err := fmt.Errorf( "HTTP response %d, query was %s\n data: %s\n response: %s", response.StatusCode, request.URL.String(), data, content) @@ -1169,7 +1169,7 @@ func (client *Client) AddComment(issueKeyOrID, body string) (*Comment, error) { var result Comment - data, _ = ioutil.ReadAll(response.Body) + data, _ = io.ReadAll(response.Body) err = json.Unmarshal(data, &result) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -1219,7 +1219,7 @@ func (client *Client) UpdateComment(issueKeyOrID, commentID, body string) ( var result Comment - data, _ = ioutil.ReadAll(response.Body) + data, _ = io.ReadAll(response.Body) err = json.Unmarshal(data, &result) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -1276,7 +1276,7 @@ func (client *Client) UpdateLabels(issueKeyOrID string, added, removed []bug.Lab defer response.Body.Close() if response.StatusCode != http.StatusNoContent { - content, _ := ioutil.ReadAll(response.Body) + content, _ := io.ReadAll(response.Body) err := fmt.Errorf( "HTTP response %d, query was %s\n data: %s\n response: %s", response.StatusCode, request.URL.String(), data, content) @@ -1332,7 +1332,7 @@ func (client *Client) GetTransitions(issueKeyOrID string) (*TransitionList, erro var message TransitionList - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &message) if err != nil { err := fmt.Errorf("Decoding response %v", err) @@ -1440,7 +1440,7 @@ func (client *Client) GetServerInfo() (*ServerInfo, error) { var message ServerInfo - data, _ := ioutil.ReadAll(response.Body) + data, _ := io.ReadAll(response.Body) err = json.Unmarshal(data, &message) if err != nil { err := fmt.Errorf("Decoding response %v", err) |