Skip to content

Commit 99dd832

Browse files
committed
go: bump go to 1.20
Bump go version to 1.20. Update ci to use go version 1.20 and newer. Remove usage of the deprecated libraries. Part of #378
1 parent f33032e commit 99dd832

File tree

7 files changed

+26
-15
lines changed

7 files changed

+26
-15
lines changed

.github/workflows/testing.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
golang:
32-
- 1.13
32+
- '1.20'
33+
- 'stable'
3334
tarantool:
3435
- '1.10'
3536
- '2.8'
@@ -40,10 +41,10 @@ jobs:
4041
include:
4142
- tarantool: 'master'
4243
coveralls: true
43-
golang: 1.13
44+
golang: '1.20'
4445
- tarantool: 'master'
4546
fuzzing: true
46-
golang: 1.18
47+
golang: '1.20'
4748
coveralls: false
4849

4950
steps:
@@ -132,7 +133,8 @@ jobs:
132133
fail-fast: false
133134
matrix:
134135
golang:
135-
- 1.13
136+
- '1.20'
137+
- 'stable'
136138
runs-on:
137139
- macos-11
138140
- macos-12

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ coverage:
114114
.PHONY: coveralls
115115
coveralls: coverage
116116
go get github.com/mattn/goveralls
117+
go install github.com/mattn/goveralls
117118
goveralls -coverprofile=$(COVERAGE_FILE) -service=github
118119

119120
.PHONY: bench-deps

future_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"context"
66
"errors"
77
"io"
8-
"io/ioutil"
98
"sync"
109
"testing"
1110
"time"
@@ -74,7 +73,7 @@ func (resp *futureMockResponse) DecodeTyped(res interface{}) error {
7473
}
7574

7675
func createFutureMockResponse(header Header, body io.Reader) (Response, error) {
77-
data, err := ioutil.ReadAll(body)
76+
data, err := io.ReadAll(body)
7877
if err != nil {
7978
return nil, err
8079
}

go.mod

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/tarantool/go-tarantool/v2
22

3-
go 1.11
3+
go 1.20
44

55
require (
66
github.com/google/uuid v1.3.0
@@ -9,3 +9,10 @@ require (
99
github.com/tarantool/go-iproto v1.0.0
1010
github.com/vmihailenco/msgpack/v5 v5.3.5
1111
)
12+
13+
require (
14+
github.com/davecgh/go-spew v1.1.0 // indirect
15+
github.com/pmezard/go-difflib v1.0.0 // indirect
16+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
17+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
18+
)

response.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package tarantool
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
76

87
"github.com/tarantool/go-iproto"
98
"github.com/vmihailenco/msgpack/v5"
@@ -39,7 +38,7 @@ func createBaseResponse(header Header, body io.Reader) (baseResponse, error) {
3938
if buf, ok := body.(*smallBuf); ok {
4039
return baseResponse{header: header, buf: *buf}, nil
4140
}
42-
data, err := ioutil.ReadAll(body)
41+
data, err := io.ReadAll(body)
4342
if err != nil {
4443
return baseResponse{}, err
4544
}

test_helpers/main.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"errors"
1616
"fmt"
1717
"io"
18-
"io/ioutil"
1918
"log"
2019
"os"
2120
"os/exec"
@@ -188,7 +187,7 @@ func StartTarantool(startOpts StartOpts) (TarantoolInstance, error) {
188187
// Create work_dir for a new instance.
189188
// TO DO: replace with `os.MkdirTemp` when we drop support of
190189
// Go 1.16 an older
191-
dir, err = ioutil.TempDir("", "work_dir")
190+
dir, err = os.MkdirTemp("", "work_dir")
192191
if err != nil {
193192
return inst, err
194193
}
@@ -305,7 +304,7 @@ func copySslCerts(dst string, sslCertsDir string) (err error) {
305304
}
306305

307306
func copyDirectoryFiles(scrDir, dest string) error {
308-
entries, err := ioutil.ReadDir(scrDir)
307+
entries, err := os.ReadDir(scrDir)
309308
if err != nil {
310309
return err
311310
}
@@ -324,7 +323,12 @@ func copyDirectoryFiles(scrDir, dest string) error {
324323
return err
325324
}
326325

327-
if err := os.Chmod(destPath, entry.Mode()); err != nil {
326+
info, err := entry.Info()
327+
if err != nil {
328+
return err
329+
}
330+
331+
if err := os.Chmod(destPath, info.Mode()); err != nil {
328332
return err
329333
}
330334
}

test_helpers/response.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package test_helpers
33
import (
44
"bytes"
55
"io"
6-
"io/ioutil"
76
"testing"
87

98
"github.com/vmihailenco/msgpack/v5"
@@ -43,7 +42,7 @@ func CreateMockResponse(header tarantool.Header, body io.Reader) (*MockResponse,
4342
if body == nil {
4443
return &MockResponse{header: header, data: nil}, nil
4544
}
46-
data, err := ioutil.ReadAll(body)
45+
data, err := io.ReadAll(body)
4746
if err != nil {
4847
return nil, err
4948
}

0 commit comments

Comments
 (0)