Skip to content

Commit a4dd5c0

Browse files
authored
Update Golang libraries to 1.19 (#457)
* Update Golang libraries to 1.19 * Fix fmt errors
1 parent 4cb31e3 commit a4dd5c0

17 files changed

+28
-35
lines changed

.travis.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ services:
2727

2828
language: go
2929
go:
30-
- 1.17.6
30+
- 1.19.4
3131

3232
env:
33-
- TEST_SUITE=run-unit-tests GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 ALWAYS=1
34-
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
35-
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0
36-
- TEST_SUITE=run-tests-cluster GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1
37-
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1 TEST_DISALLOW_UNKNOWN_FIELDS=false ALWAYS=1
38-
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
39-
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0
40-
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1 ALWAYS=1
33+
- TEST_SUITE=run-unit-tests GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 ALWAYS=1
34+
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
35+
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0
36+
- TEST_SUITE=run-tests-cluster GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1
37+
- TEST_SUITE=run-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1 TEST_DISALLOW_UNKNOWN_FIELDS=false ALWAYS=1
38+
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.8.5.1
39+
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=eu.gcr.io/arangodb-ci/official/arangodb/arangodb:3.9.0
40+
- TEST_SUITE=run-v2-tests-single GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 STARTER=gcr.io/gcr-for-testing/arangodb/arangodb-starter:latest ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.4 ARANGODB=gcr.io/gcr-for-testing/arangodb/arangodb-preview:3.10.0-rc.1 ALWAYS=1
4141

4242
before_script:
4343
- |

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/go-driver/tree/master) (N/A)
4+
- Use Go 1.19.4
45

56
## [1.4.1](https://github.com/arangodb/go-driver/tree/v1.4.1) (2022-12-14)
67
- Add support for `checksum` in Collections

Dockerfile.debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17.6 as builder
1+
FROM golang:1.19.4 as builder
22

33
ARG TESTS_DIRECTORY
44
ARG TESTS_ROOT_PATH="."

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SCRIPTDIR := $(shell pwd)
44
CURR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
55
ROOTDIR:=$(CURR)
66

7-
GOVERSION ?= 1.17.6
7+
GOVERSION ?= 1.19.4
88
GOIMAGE ?= golang:$(GOVERSION)
99
GOV2IMAGE ?= $(GOIMAGE)
1010
ALPINE_IMAGE ?= alpine:3.14
@@ -495,7 +495,7 @@ run-benchmarks-single-vpack-no-auth:
495495
.PHONY: tools
496496
tools: __dir_setup
497497
@echo ">> Fetching golangci-lint linter"
498-
@GOBIN=$(TMPDIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
498+
@GOBIN=$(TMPDIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
499499
@echo ">> Fetching goimports"
500500
@GOBIN=$(TMPDIR)/bin go install golang.org/x/tools/cmd/[email protected]
501501
@echo ">> Fetching license check"

doc.go

-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@ To get started, create a connection to the database and wrap a client around it.
3939
if err != nil {
4040
// Handle error
4141
}
42-
4342
*/
4443
package driver

foxx.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ package driver
2424

2525
import (
2626
"context"
27-
"io/ioutil"
2827
"net/http"
28+
"os"
2929
"strconv"
3030
)
3131

@@ -40,7 +40,7 @@ func (c *client) InstallFoxxService(ctx context.Context, zipFile string, options
4040
req.SetHeader("Content-Type", "application/zip")
4141
req.SetQuery("mount", options.Mount)
4242

43-
bytes, err := ioutil.ReadFile(zipFile)
43+
bytes, err := os.ReadFile(zipFile)
4444
if err != nil {
4545
return WithStack(err)
4646
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/arangodb/go-driver
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g=
22
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho=
3-
github.com/coreos/go-iptables v0.4.3 h1:jJg1aFuhCqWbgBl1VTqgTHG5faPM60A5JDMjQ2HYv+A=
4-
github.com/coreos/go-iptables v0.4.3/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU=
53
github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk=
64
github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
75
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=

http/connection.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"crypto/tls"
2929
"encoding/json"
3030
"fmt"
31-
"io/ioutil"
31+
"io"
3232
"net"
3333
"net/http"
3434
"net/http/httptrace"
@@ -334,7 +334,7 @@ func readBody(resp *http.Response) ([]byte, error) {
334334
contentLength := resp.ContentLength
335335
if contentLength < 0 {
336336
// Don't know the content length, do it the slowest way
337-
result, err := ioutil.ReadAll(resp.Body)
337+
result, err := io.ReadAll(resp.Body)
338338
if err != nil {
339339
return nil, driver.WithStack(err)
340340
}

http/doc.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This connection uses HTTP or HTTPS to connect to the ArangoDB database and
2727
encodes its content as JSON or Velocypack, depending on the value
2828
of the `ContentType` fields in the `http.ConnectionConfig`.
2929
30-
Creating an Insecure Connection
30+
# Creating an Insecure Connection
3131
3232
To create an HTTP connection, use code like this.
3333
@@ -50,7 +50,7 @@ for normal database requests.
5050
// Handle error
5151
}
5252
53-
Creating a Secure Connection
53+
# Creating a Secure Connection
5454
5555
To create a secure HTTPS connection, use code like this.
5656
@@ -64,6 +64,5 @@ To create a secure HTTPS connection, use code like this.
6464
if err != nil {
6565
// Handle error
6666
}
67-
6867
*/
6968
package http

jwt/doc.go

-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,5 @@ To use a JWT secret to access your database, use code like this:
5252
if err != nil {
5353
// Handle error
5454
}
55-
5655
*/
5756
package jwt

user_impl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (u *user) Name() string {
6565
return u.data.Name
6666
}
6767

68-
// Is this an active user?
68+
// Is this an active user?
6969
func (u *user) IsActive() bool {
7070
return u.data.Active
7171
}

v2/connection/connection_http_request.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ package connection
2525
import (
2626
"context"
2727
"io"
28-
"io/ioutil"
2928
"net/http"
3029
"net/url"
3130
)
@@ -113,7 +112,7 @@ func (j *httpRequest) asRequest(ctx context.Context, bodyReader bodyReadFactory)
113112
} else if c, ok := body.(io.ReadCloser); ok {
114113
return c, nil
115114
} else {
116-
return ioutil.NopCloser(body), nil
115+
return io.NopCloser(body), nil
117116
}
118117
}
119118

v2/connection/decoder.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"encoding/json"
2828
"errors"
2929
"io"
30-
"io/ioutil"
3130

3231
"github.com/arangodb/go-velocypack"
3332
)
@@ -107,7 +106,7 @@ type bytesDecoder struct {
107106

108107
// Decode decodes bytes from the reader into the obj.
109108
func (j bytesDecoder) Decode(reader io.Reader, obj interface{}) error {
110-
result, err := ioutil.ReadAll(reader)
109+
result, err := io.ReadAll(reader)
111110
if err != nil {
112111
return err
113112
}

v2/go.mod

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

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e

v2/tests/call_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package tests
2424

2525
import (
2626
"context"
27-
"io/ioutil"
27+
"io"
2828
"net/http"
2929
"testing"
3030

@@ -46,7 +46,7 @@ func Test_CallStream(t *testing.T) {
4646

4747
version := arangodb.VersionInfo{}
4848
require.NoError(t, dec.Decode(body, &version))
49-
data, err := ioutil.ReadAll(body)
49+
data, err := io.ReadAll(body)
5050
require.NoError(t, err)
5151
require.Len(t, data, 0)
5252
require.GreaterOrEqual(t, version.Version.Major(), 3)

vst/doc.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Package vst implements driver.Connection using a VelocyStream connection.
2626
This connection uses VelocyStream (with optional TLS) to connect to the ArangoDB database.
2727
It encodes its contents as Velocypack.
2828
29-
Creating an Insecure Connection
29+
# Creating an Insecure Connection
3030
3131
To create a VST connection, use code like this.
3232
@@ -49,7 +49,7 @@ for normal database requests.
4949
// Handle error
5050
}
5151
52-
Creating a Secure Connection
52+
# Creating a Secure Connection
5353
5454
To create a secure VST connection, use code like this.
5555
@@ -63,6 +63,5 @@ To create a secure VST connection, use code like this.
6363
if err != nil {
6464
// Handle error
6565
}
66-
6766
*/
6867
package vst

0 commit comments

Comments
 (0)