diff --git a/.travis.yml b/.travis.yml index 52fd4216..f6bee126 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,17 +27,17 @@ services: language: go go: - - 1.17.6 + - 1.19.4 env: - - TEST_SUITE=run-unit-tests GOIMAGE=gcr.io/gcr-for-testing/golang:1.17.6 ALWAYS=1 - - 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 - - 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 - - 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 - - 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 - - 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 - - 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 - - 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 + - TEST_SUITE=run-unit-tests GOIMAGE=gcr.io/gcr-for-testing/golang:1.19.4 ALWAYS=1 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 before_script: - | diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dad0095..088f9e4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/go-driver/tree/master) (N/A) +- Use Go 1.19.4 ## [1.4.1](https://github.com/arangodb/go-driver/tree/v1.4.1) (2022-12-14) - Add support for `checksum` in Collections diff --git a/Dockerfile.debug b/Dockerfile.debug index db81ce49..3e92af44 100644 --- a/Dockerfile.debug +++ b/Dockerfile.debug @@ -1,4 +1,4 @@ -FROM golang:1.17.6 as builder +FROM golang:1.19.4 as builder ARG TESTS_DIRECTORY ARG TESTS_ROOT_PATH="." diff --git a/Makefile b/Makefile index ceac3a3d..a0461c19 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SCRIPTDIR := $(shell pwd) CURR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) ROOTDIR:=$(CURR) -GOVERSION ?= 1.17.6 +GOVERSION ?= 1.19.4 GOIMAGE ?= golang:$(GOVERSION) GOV2IMAGE ?= $(GOIMAGE) ALPINE_IMAGE ?= alpine:3.14 @@ -495,7 +495,7 @@ run-benchmarks-single-vpack-no-auth: .PHONY: tools tools: __dir_setup @echo ">> Fetching golangci-lint linter" - @GOBIN=$(TMPDIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 + @GOBIN=$(TMPDIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1 @echo ">> Fetching goimports" @GOBIN=$(TMPDIR)/bin go install golang.org/x/tools/cmd/goimports@v0.1.12 @echo ">> Fetching license check" diff --git a/doc.go b/doc.go index 2e3f4851..69cde6d3 100644 --- a/doc.go +++ b/doc.go @@ -39,6 +39,5 @@ To get started, create a connection to the database and wrap a client around it. if err != nil { // Handle error } - */ package driver diff --git a/foxx.go b/foxx.go index 0ea203c5..aad80862 100644 --- a/foxx.go +++ b/foxx.go @@ -24,8 +24,8 @@ package driver import ( "context" - "io/ioutil" "net/http" + "os" "strconv" ) @@ -40,7 +40,7 @@ func (c *client) InstallFoxxService(ctx context.Context, zipFile string, options req.SetHeader("Content-Type", "application/zip") req.SetQuery("mount", options.Mount) - bytes, err := ioutil.ReadFile(zipFile) + bytes, err := os.ReadFile(zipFile) if err != nil { return WithStack(err) } diff --git a/go.mod b/go.mod index 6c0a7438..78793445 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/arangodb/go-driver -go 1.17 +go 1.19 require ( github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e diff --git a/go.sum b/go.sum index 1c8dce54..68ff8a22 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g= github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho= -github.com/coreos/go-iptables v0.4.3 h1:jJg1aFuhCqWbgBl1VTqgTHG5faPM60A5JDMjQ2HYv+A= -github.com/coreos/go-iptables v0.4.3/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk= github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= diff --git a/http/connection.go b/http/connection.go index 8b16a6d3..fed892f3 100644 --- a/http/connection.go +++ b/http/connection.go @@ -28,7 +28,7 @@ import ( "crypto/tls" "encoding/json" "fmt" - "io/ioutil" + "io" "net" "net/http" "net/http/httptrace" @@ -334,7 +334,7 @@ func readBody(resp *http.Response) ([]byte, error) { contentLength := resp.ContentLength if contentLength < 0 { // Don't know the content length, do it the slowest way - result, err := ioutil.ReadAll(resp.Body) + result, err := io.ReadAll(resp.Body) if err != nil { return nil, driver.WithStack(err) } diff --git a/http/doc.go b/http/doc.go index 0cffc2b0..f3f3c6c2 100644 --- a/http/doc.go +++ b/http/doc.go @@ -27,7 +27,7 @@ This connection uses HTTP or HTTPS to connect to the ArangoDB database and encodes its content as JSON or Velocypack, depending on the value of the `ContentType` fields in the `http.ConnectionConfig`. -Creating an Insecure Connection +# Creating an Insecure Connection To create an HTTP connection, use code like this. @@ -50,7 +50,7 @@ for normal database requests. // Handle error } -Creating a Secure Connection +# Creating a Secure Connection To create a secure HTTPS connection, use code like this. @@ -64,6 +64,5 @@ To create a secure HTTPS connection, use code like this. if err != nil { // Handle error } - */ package http diff --git a/jwt/doc.go b/jwt/doc.go index 7d226ee3..c5edb778 100644 --- a/jwt/doc.go +++ b/jwt/doc.go @@ -52,6 +52,5 @@ To use a JWT secret to access your database, use code like this: if err != nil { // Handle error } - */ package jwt diff --git a/user_impl.go b/user_impl.go index 243081f6..e57f435c 100644 --- a/user_impl.go +++ b/user_impl.go @@ -65,7 +65,7 @@ func (u *user) Name() string { return u.data.Name } -// Is this an active user? +// Is this an active user? func (u *user) IsActive() bool { return u.data.Active } diff --git a/v2/connection/connection_http_request.go b/v2/connection/connection_http_request.go index 9e6a56f4..717ced47 100644 --- a/v2/connection/connection_http_request.go +++ b/v2/connection/connection_http_request.go @@ -25,7 +25,6 @@ package connection import ( "context" "io" - "io/ioutil" "net/http" "net/url" ) @@ -113,7 +112,7 @@ func (j *httpRequest) asRequest(ctx context.Context, bodyReader bodyReadFactory) } else if c, ok := body.(io.ReadCloser); ok { return c, nil } else { - return ioutil.NopCloser(body), nil + return io.NopCloser(body), nil } } diff --git a/v2/connection/decoder.go b/v2/connection/decoder.go index ff7812d2..79121c0d 100644 --- a/v2/connection/decoder.go +++ b/v2/connection/decoder.go @@ -27,7 +27,6 @@ import ( "encoding/json" "errors" "io" - "io/ioutil" "github.com/arangodb/go-velocypack" ) @@ -107,7 +106,7 @@ type bytesDecoder struct { // Decode decodes bytes from the reader into the obj. func (j bytesDecoder) Decode(reader io.Reader, obj interface{}) error { - result, err := ioutil.ReadAll(reader) + result, err := io.ReadAll(reader) if err != nil { return err } diff --git a/v2/go.mod b/v2/go.mod index 6e1678e3..0a152b1e 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -1,6 +1,6 @@ module github.com/arangodb/go-driver/v2 -go 1.17 +go 1.19 require ( github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e diff --git a/v2/tests/call_test.go b/v2/tests/call_test.go index a092ec8d..fa925530 100644 --- a/v2/tests/call_test.go +++ b/v2/tests/call_test.go @@ -24,7 +24,7 @@ package tests import ( "context" - "io/ioutil" + "io" "net/http" "testing" @@ -46,7 +46,7 @@ func Test_CallStream(t *testing.T) { version := arangodb.VersionInfo{} require.NoError(t, dec.Decode(body, &version)) - data, err := ioutil.ReadAll(body) + data, err := io.ReadAll(body) require.NoError(t, err) require.Len(t, data, 0) require.GreaterOrEqual(t, version.Version.Major(), 3) diff --git a/vst/doc.go b/vst/doc.go index 2337aea2..2c482d2a 100644 --- a/vst/doc.go +++ b/vst/doc.go @@ -26,7 +26,7 @@ Package vst implements driver.Connection using a VelocyStream connection. This connection uses VelocyStream (with optional TLS) to connect to the ArangoDB database. It encodes its contents as Velocypack. -Creating an Insecure Connection +# Creating an Insecure Connection To create a VST connection, use code like this. @@ -49,7 +49,7 @@ for normal database requests. // Handle error } -Creating a Secure Connection +# Creating a Secure Connection To create a secure VST connection, use code like this. @@ -63,6 +63,5 @@ To create a secure VST connection, use code like this. if err != nil { // Handle error } - */ package vst