Skip to content

Commit

Permalink
Update Golang libraries to 1.19 (#457)
Browse files Browse the repository at this point in the history
* Update Golang libraries to 1.19

* Fix fmt errors
  • Loading branch information
jwierzbo authored Dec 21, 2022
1 parent 4cb31e3 commit a4dd5c0
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 35 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -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="."
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
@echo ">> Fetching license check"
Expand Down
1 change: 0 additions & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions foxx.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ package driver

import (
"context"
"io/ioutil"
"net/http"
"os"
"strconv"
)

Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
4 changes: 2 additions & 2 deletions http/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/http/httptrace"
Expand Down Expand Up @@ -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)
}
Expand Down
5 changes: 2 additions & 3 deletions http/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -64,6 +64,5 @@ To create a secure HTTPS connection, use code like this.
if err != nil {
// Handle error
}
*/
package http
1 change: 0 additions & 1 deletion jwt/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ To use a JWT secret to access your database, use code like this:
if err != nil {
// Handle error
}
*/
package jwt
2 changes: 1 addition & 1 deletion user_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions v2/connection/connection_http_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package connection
import (
"context"
"io"
"io/ioutil"
"net/http"
"net/url"
)
Expand Down Expand Up @@ -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
}
}

Expand Down
3 changes: 1 addition & 2 deletions v2/connection/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"encoding/json"
"errors"
"io"
"io/ioutil"

"github.com/arangodb/go-velocypack"
)
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions v2/tests/call_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package tests

import (
"context"
"io/ioutil"
"io"
"net/http"
"testing"

Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions vst/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -63,6 +63,5 @@ To create a secure VST connection, use code like this.
if err != nil {
// Handle error
}
*/
package vst

0 comments on commit a4dd5c0

Please sign in to comment.