Skip to content

Commit

Permalink
api: bump go to 1.20
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DerekBum committed Feb 8, 2024
1 parent f33032e commit 3cb64eb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
fail-fast: false
matrix:
golang:
- 1.13
- 1.20
- stable
tarantool:
- '1.10'
- '2.8'
Expand All @@ -40,10 +41,10 @@ jobs:
include:
- tarantool: 'master'
coveralls: true
golang: 1.13
golang: 1.20
- tarantool: 'master'
fuzzing: true
golang: 1.18
golang: 1.20
coveralls: false

steps:
Expand Down Expand Up @@ -132,7 +133,7 @@ jobs:
fail-fast: false
matrix:
golang:
- 1.13
- 1.20
runs-on:
- macos-11
- macos-12
Expand Down
3 changes: 1 addition & 2 deletions future_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -74,7 +73,7 @@ func (resp *futureMockResponse) DecodeTyped(res interface{}) error {
}

func createFutureMockResponse(header Header, body io.Reader) (Response, error) {
data, err := ioutil.ReadAll(body)
data, err := io.ReadAll(body)
if err != nil {
return nil, err
}
Expand Down
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tarantool/go-tarantool/v2

go 1.11
go 1.20

require (
github.com/google/uuid v1.3.0
Expand All @@ -9,3 +9,10 @@ require (
github.com/tarantool/go-iproto v1.0.0
github.com/vmihailenco/msgpack/v5 v5.3.5
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
3 changes: 1 addition & 2 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tarantool
import (
"fmt"
"io"
"io/ioutil"

"github.com/tarantool/go-iproto"
"github.com/vmihailenco/msgpack/v5"
Expand Down Expand Up @@ -39,7 +38,7 @@ func createBaseResponse(header Header, body io.Reader) (baseResponse, error) {
if buf, ok := body.(*smallBuf); ok {
return baseResponse{header: header, buf: *buf}, nil
}
data, err := ioutil.ReadAll(body)
data, err := io.ReadAll(body)
if err != nil {
return baseResponse{}, err
}
Expand Down
12 changes: 8 additions & 4 deletions test_helpers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -188,7 +187,7 @@ func StartTarantool(startOpts StartOpts) (TarantoolInstance, error) {
// Create work_dir for a new instance.
// TO DO: replace with `os.MkdirTemp` when we drop support of
// Go 1.16 an older
dir, err = ioutil.TempDir("", "work_dir")
dir, err = os.MkdirTemp("", "work_dir")
if err != nil {
return inst, err
}
Expand Down Expand Up @@ -305,7 +304,7 @@ func copySslCerts(dst string, sslCertsDir string) (err error) {
}

func copyDirectoryFiles(scrDir, dest string) error {
entries, err := ioutil.ReadDir(scrDir)
entries, err := os.ReadDir(scrDir)
if err != nil {
return err
}
Expand All @@ -324,7 +323,12 @@ func copyDirectoryFiles(scrDir, dest string) error {
return err
}

if err := os.Chmod(destPath, entry.Mode()); err != nil {
info, err := entry.Info()
if err != nil {
return err
}

if err := os.Chmod(destPath, info.Mode()); err != nil {
return err
}
}
Expand Down
3 changes: 1 addition & 2 deletions test_helpers/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package test_helpers
import (
"bytes"
"io"
"io/ioutil"
"testing"

"github.com/vmihailenco/msgpack/v5"
Expand Down Expand Up @@ -43,7 +42,7 @@ func CreateMockResponse(header tarantool.Header, body io.Reader) (*MockResponse,
if body == nil {
return &MockResponse{header: header, data: nil}, nil
}
data, err := ioutil.ReadAll(body)
data, err := io.ReadAll(body)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3cb64eb

Please sign in to comment.