Skip to content

Commit 93f28dd

Browse files
authored
Merge pull request #735 from andygrunwald/v1.17.0-dev-upgrade-dependencies
* upgraded github.com/google/go-cmp v0.5.8 => v0.7.0 * upgraded go 1.15 => 1.21 (required for the go-cmp upgrade) * upgraded github.com/golang-jwt/jwt/v4 v4.4.2 => v4.5.2 * Github Actions: Upgrade actions/checkout from v3 to v5 * Github Actions: Upgrade actions/setup-go from v3 to v6 * Github Actions: Upgrade dominikh/staticcheck-action from v1.2 to v1.4 * upgraded static v2022.1 => v2023.1 * Remove deprecated `ioutil` package * Get Continuous Integration working again
2 parents f4a2f9d + 00778a6 commit 93f28dd

28 files changed

+112
-110
lines changed

.github/workflows/testing.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
go: [ '1.18', '1.17' ]
18+
go: [ '1.22', '1.21' ]
1919
os: [ 'windows-latest', 'ubuntu-latest', 'macOS-latest' ]
2020
runs-on: ${{ matrix.os }}
2121

2222
steps:
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-go@v3
23+
- uses: actions/checkout@v5
24+
- uses: actions/setup-go@v6
2525
with:
2626
go-version: ${{ matrix.go }}
2727

@@ -33,9 +33,9 @@ jobs:
3333
run: make vet
3434

3535
- name: Run staticcheck (Go ${{ matrix.go }})
36-
uses: dominikh/staticcheck-action@v1.2.0
36+
uses: dominikh/staticcheck-action@v1.4.0
3737
with:
38-
version: "2022.1"
38+
version: "2023.1"
3939
install-go: false
4040
cache-key: ${{ matrix.go }}
4141

authentication.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
)
1010

@@ -188,7 +188,7 @@ func (s *AuthenticationService) GetCurrentUserWithContext(ctx context.Context) (
188188
return nil, fmt.Errorf("getting user info failed with status : %d", resp.StatusCode)
189189
}
190190
ret := new(Session)
191-
data, err := ioutil.ReadAll(resp.Body)
191+
data, err := io.ReadAll(resp.Body)
192192
if err != nil {
193193
return nil, fmt.Errorf("couldn't read body from the response : %s", err)
194194
}

authentication_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package jira
33
import (
44
"bytes"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"reflect"
99
"testing"
@@ -15,7 +15,7 @@ func TestAuthenticationService_AcquireSessionCookie_Failure(t *testing.T) {
1515
testMux.HandleFunc("/rest/auth/1/session", func(w http.ResponseWriter, r *http.Request) {
1616
testMethod(t, r, "POST")
1717
testRequestURL(t, r, "/rest/auth/1/session")
18-
b, err := ioutil.ReadAll(r.Body)
18+
b, err := io.ReadAll(r.Body)
1919
if err != nil {
2020
t.Errorf("Error in read body: %s", err)
2121
}
@@ -49,7 +49,7 @@ func TestAuthenticationService_AcquireSessionCookie_Success(t *testing.T) {
4949
testMux.HandleFunc("/rest/auth/1/session", func(w http.ResponseWriter, r *http.Request) {
5050
testMethod(t, r, "POST")
5151
testRequestURL(t, r, "/rest/auth/1/session")
52-
b, err := ioutil.ReadAll(r.Body)
52+
b, err := io.ReadAll(r.Body)
5353
if err != nil {
5454
t.Errorf("Error in read body: %s", err)
5555
}
@@ -140,7 +140,7 @@ func TestAuthenticationService_GetUserInfo_AccessForbidden_Fail(t *testing.T) {
140140
if r.Method == "POST" {
141141
testMethod(t, r, "POST")
142142
testRequestURL(t, r, "/rest/auth/1/session")
143-
b, err := ioutil.ReadAll(r.Body)
143+
b, err := io.ReadAll(r.Body)
144144
if err != nil {
145145
t.Errorf("Error in read body: %s", err)
146146
}
@@ -178,7 +178,7 @@ func TestAuthenticationService_GetUserInfo_NonOkStatusCode_Fail(t *testing.T) {
178178
if r.Method == "POST" {
179179
testMethod(t, r, "POST")
180180
testRequestURL(t, r, "/rest/auth/1/session")
181-
b, err := ioutil.ReadAll(r.Body)
181+
b, err := io.ReadAll(r.Body)
182182
if err != nil {
183183
t.Errorf("Error in read body: %s", err)
184184
}
@@ -234,7 +234,7 @@ func TestAuthenticationService_GetUserInfo_Success(t *testing.T) {
234234
if r.Method == "POST" {
235235
testMethod(t, r, "POST")
236236
testRequestURL(t, r, "/rest/auth/1/session")
237-
b, err := ioutil.ReadAll(r.Body)
237+
b, err := io.ReadAll(r.Body)
238238
if err != nil {
239239
t.Errorf("Error in read body: %s", err)
240240
}
@@ -276,7 +276,7 @@ func TestAuthenticationService_Logout_Success(t *testing.T) {
276276
if r.Method == "POST" {
277277
testMethod(t, r, "POST")
278278
testRequestURL(t, r, "/rest/auth/1/session")
279-
b, err := ioutil.ReadAll(r.Body)
279+
b, err := io.ReadAll(r.Body)
280280
if err != nil {
281281
t.Errorf("Error in read body: %s", err)
282282
}

board_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package jira
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"net/http"
6+
"os"
77
"testing"
88
)
99

@@ -12,7 +12,7 @@ func TestBoardService_GetAllBoards(t *testing.T) {
1212
defer teardown()
1313
testAPIEdpoint := "/rest/agile/1.0/board"
1414

15-
raw, err := ioutil.ReadFile("./mocks/all_boards.json")
15+
raw, err := os.ReadFile("./mocks/all_boards.json")
1616
if err != nil {
1717
t.Error(err.Error())
1818
}
@@ -37,7 +37,7 @@ func TestBoardService_GetAllBoards_WithFilter(t *testing.T) {
3737
defer teardown()
3838
testAPIEdpoint := "/rest/agile/1.0/board"
3939

40-
raw, err := ioutil.ReadFile("./mocks/all_boards_filtered.json")
40+
raw, err := os.ReadFile("./mocks/all_boards_filtered.json")
4141
if err != nil {
4242
t.Error(err.Error())
4343
}
@@ -160,7 +160,7 @@ func TestBoardService_GetAllSprints(t *testing.T) {
160160

161161
testAPIEndpoint := "/rest/agile/1.0/board/123/sprint"
162162

163-
raw, err := ioutil.ReadFile("./mocks/sprints.json")
163+
raw, err := os.ReadFile("./mocks/sprints.json")
164164
if err != nil {
165165
t.Error(err.Error())
166166
}
@@ -192,7 +192,7 @@ func TestBoardService_GetAllSprintsWithOptions(t *testing.T) {
192192

193193
testAPIEndpoint := "/rest/agile/1.0/board/123/sprint"
194194

195-
raw, err := ioutil.ReadFile("./mocks/sprints_filtered.json")
195+
raw, err := os.ReadFile("./mocks/sprints_filtered.json")
196196
if err != nil {
197197
t.Error(err.Error())
198198
}
@@ -223,7 +223,7 @@ func TestBoardService_GetBoardConfigoration(t *testing.T) {
223223
defer teardown()
224224
testAPIEndpoint := "/rest/agile/1.0/board/35/configuration"
225225

226-
raw, err := ioutil.ReadFile("./mocks/board_configuration.json")
226+
raw, err := os.ReadFile("./mocks/board_configuration.json")
227227
if err != nil {
228228
t.Error(err.Error())
229229
}

error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"strings"
99

1010
"github.com/pkg/errors"
@@ -25,7 +25,7 @@ func NewJiraError(resp *Response, httpError error) error {
2525
}
2626

2727
defer resp.Body.Close()
28-
body, err := ioutil.ReadAll(resp.Body)
28+
body, err := io.ReadAll(resp.Body)
2929
if err != nil {
3030
return errors.Wrap(err, httpError.Error())
3131
}

examples/addlabel/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"bufio"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"os"
88
"strings"
99
"syscall"
@@ -67,7 +67,7 @@ func main() {
6767
if err != nil {
6868
fmt.Println(err)
6969
}
70-
body, _ := ioutil.ReadAll(resp.Body)
70+
body, _ := io.ReadAll(resp.Body)
7171
fmt.Println(string(body))
7272

7373
issue, _, _ := client.Issue.Get(issueId, nil)

field_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package jira
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"net/http"
6+
"os"
77
"testing"
88
)
99

@@ -12,7 +12,7 @@ func TestFieldService_GetList(t *testing.T) {
1212
defer teardown()
1313
testAPIEdpoint := "/rest/api/2/field"
1414

15-
raw, err := ioutil.ReadFile("./mocks/all_fields.json")
15+
raw, err := os.ReadFile("./mocks/all_fields.json")
1616
if err != nil {
1717
t.Error(err.Error())
1818
}

filter_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package jira
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"net/http"
6+
"os"
77
"testing"
88
)
99

1010
func TestFilterService_GetList(t *testing.T) {
1111
setup()
1212
defer teardown()
1313
testAPIEndpoint := "/rest/api/2/filter"
14-
raw, err := ioutil.ReadFile("./mocks/all_filters.json")
14+
raw, err := os.ReadFile("./mocks/all_filters.json")
1515
if err != nil {
1616
t.Error(err.Error())
1717
}
@@ -34,7 +34,7 @@ func TestFilterService_Get(t *testing.T) {
3434
setup()
3535
defer teardown()
3636
testAPIEndpoint := "/rest/api/2/filter/10000"
37-
raw, err := ioutil.ReadFile("./mocks/filter.json")
37+
raw, err := os.ReadFile("./mocks/filter.json")
3838
if err != nil {
3939
t.Error(err.Error())
4040
}
@@ -58,7 +58,7 @@ func TestFilterService_GetFavouriteList(t *testing.T) {
5858
setup()
5959
defer teardown()
6060
testAPIEndpoint := "/rest/api/2/filter/favourite"
61-
raw, err := ioutil.ReadFile("./mocks/favourite_filters.json")
61+
raw, err := os.ReadFile("./mocks/favourite_filters.json")
6262
if err != nil {
6363
t.Error(err.Error())
6464
}
@@ -81,7 +81,7 @@ func TestFilterService_GetMyFilters(t *testing.T) {
8181
setup()
8282
defer teardown()
8383
testAPIEndpoint := "/rest/api/3/filter/my"
84-
raw, err := ioutil.ReadFile("./mocks/my_filters.json")
84+
raw, err := os.ReadFile("./mocks/my_filters.json")
8585
if err != nil {
8686
t.Error(err.Error())
8787
}
@@ -105,7 +105,7 @@ func TestFilterService_Search(t *testing.T) {
105105
setup()
106106
defer teardown()
107107
testAPIEndpoint := "/rest/api/3/filter/search"
108-
raw, err := ioutil.ReadFile("./mocks/search_filters.json")
108+
raw, err := os.ReadFile("./mocks/search_filters.json")
109109
if err != nil {
110110
t.Error(err.Error())
111111
}

go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
module github.com/andygrunwald/go-jira
22

3-
go 1.15
3+
go 1.21
44

55
require (
66
github.com/fatih/structs v1.1.0
7-
github.com/golang-jwt/jwt/v4 v4.4.2
8-
github.com/google/go-cmp v0.5.8
7+
github.com/golang-jwt/jwt/v4 v4.5.2
8+
github.com/google/go-cmp v0.7.0
99
github.com/google/go-querystring v1.1.0
1010
github.com/pkg/errors v0.9.1
1111
github.com/trivago/tgo v1.0.7
12-
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
1312
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
1413
)
14+
15+
require golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
22
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
3-
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
4-
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
3+
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
4+
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
55
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
6-
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
7-
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
6+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
7+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
88
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
99
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
1010
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

0 commit comments

Comments
 (0)