diff --git a/build/Dockerfile b/build/Dockerfile index 209024254..8a7eaf299 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine as builder +FROM golang:1.19-alpine as builder WORKDIR /go/src/app COPY src . diff --git a/build/build.sh b/build/build.sh index 0e3f33dd0..a18fd28f2 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,7 +12,7 @@ usage() { } ROOT=$(dirname $(dirname $(readlink -f $0))) -GOVER=1.18 # go version +GOVER=1.19 # go version CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache # Figure out os and architecture diff --git a/docker/Dockerfile b/docker/Dockerfile index 403bd4420..48238f2ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,7 +4,7 @@ # It is not used for deployments. ## Build -FROM golang:1.18 AS base +FROM golang:1.19 AS base WORKDIR /src diff --git a/src/cli/config/config_test.go b/src/cli/config/config_test.go index b2ffaf761..0981dc7e1 100644 --- a/src/cli/config/config_test.go +++ b/src/cli/config/config_test.go @@ -2,7 +2,6 @@ package config import ( "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -53,7 +52,7 @@ func (suite *ConfigSuite) TestReadRepoConfigBasic() { // Generate test config file testConfigData := fmt.Sprintf(configFileTemplate, b, tID) testConfigFilePath := filepath.Join(t.TempDir(), "corso.toml") - err := ioutil.WriteFile(testConfigFilePath, []byte(testConfigData), 0o700) + err := os.WriteFile(testConfigFilePath, []byte(testConfigData), 0o700) require.NoError(t, err) // Configure viper to read test config file diff --git a/src/go.mod b/src/go.mod index 9388e1c81..8d5793541 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,6 +1,6 @@ module github.com/alcionai/corso/src -go 1.18 +go 1.19 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 diff --git a/src/internal/connector/mockconnector/mock_data_collection_test.go b/src/internal/connector/mockconnector/mock_data_collection_test.go index 78de76b7a..c9be7eeba 100644 --- a/src/internal/connector/mockconnector/mock_data_collection_test.go +++ b/src/internal/connector/mockconnector/mock_data_collection_test.go @@ -3,7 +3,6 @@ package mockconnector_test import ( "bytes" "io" - "io/ioutil" "testing" "github.com/microsoftgraph/msgraph-sdk-go/models" @@ -30,7 +29,7 @@ func (suite *MockExchangeCollectionSuite) TestMockExchangeCollection() { messagesRead := 0 for item := range mdc.Items() { - _, err := ioutil.ReadAll(item.ToReader()) + _, err := io.ReadAll(item.ToReader()) assert.NoError(suite.T(), err) messagesRead++ } @@ -45,7 +44,7 @@ func (suite *MockExchangeCollectionSuite) TestMockExchangeCollectionItemSize() { mdc.Data[1] = []byte("This is some buffer of data so that the size is different than the default") for item := range mdc.Items() { - buf, err := ioutil.ReadAll(item.ToReader()) + buf, err := io.ReadAll(item.ToReader()) assert.NoError(t, err) assert.Implements(t, (*data.StreamSize)(nil), item) @@ -110,7 +109,7 @@ func (suite *MockExchangeDataSuite) TestMockExchangeData() { for _, test := range table { suite.T().Run(test.name, func(t *testing.T) { assert.Equal(t, id, test.reader.UUID()) - buf, err := ioutil.ReadAll(test.reader.ToReader()) + buf, err := io.ReadAll(test.reader.ToReader()) test.check(t, err) if err != nil { diff --git a/src/internal/kopia/data_collection_test.go b/src/internal/kopia/data_collection_test.go index 7b2910911..c28c54af8 100644 --- a/src/internal/kopia/data_collection_test.go +++ b/src/internal/kopia/data_collection_test.go @@ -3,7 +3,6 @@ package kopia import ( "bytes" "io" - "io/ioutil" "testing" "github.com/stretchr/testify/assert" @@ -100,7 +99,7 @@ func (suite *KopiaDataCollectionUnitSuite) TestReturnsStreams() { assert.Equal(t, returnedStream.UUID(), uuids[count]) - buf, err := ioutil.ReadAll(returnedStream.ToReader()) + buf, err := io.ReadAll(returnedStream.ToReader()) require.NoError(t, err) assert.Equal(t, buf, testData[count]) require.Implements(t, (*data.StreamSize)(nil), returnedStream) diff --git a/src/internal/kopia/wrapper_test.go b/src/internal/kopia/wrapper_test.go index a88bd2a75..afe418748 100644 --- a/src/internal/kopia/wrapper_test.go +++ b/src/internal/kopia/wrapper_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "io" - "io/ioutil" stdpath "path" "testing" @@ -68,7 +67,7 @@ func testForFiles( expected, ok := expected[fullPath.String()] require.True(t, ok, "unexpected file with path %q", fullPath) - buf, err := ioutil.ReadAll(s.ToReader()) + buf, err := io.ReadAll(s.ToReader()) require.NoError(t, err, "reading collection item: %s", fullPath) assert.Equal(t, expected, buf, "comparing collection item: %s", fullPath) diff --git a/website/Makefile b/website/Makefile index 528bfc214..1b26cb2df 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,5 +1,6 @@ .PHONY: buildimage build dev shell check genclidocs _validatemdgen publish sync +GO_VERSION := 1.19 CORSO_BUILD_DIR := /tmp/.corsobuild CORSO_BUILD_CACHE := ${CORSO_BUILD_DIR}/cache CORSO_BUILD_MOD := ${CORSO_BUILD_DIR}/mod @@ -12,8 +13,8 @@ CBASE := docker run --rm -it \ -v ${CORSO_LOCAL_PATH}:${CORSO_REPO} -v ${CORSO_BUILD_DIR}:${CORSO_BUILD_DIR} \ --env GOCACHE=${CORSO_BUILD_CACHE} --env GOMODCACHE=${CORSO_BUILD_MOD} --env GOTMPDIR=${CORSO_BUILD_DIR} \ --workdir ${CORSO_REPO}/src -GOC := ${CBASE} golang:1.18 -GOBASHC := ${CBASE} --entrypoint bash golang:1.18 +GOC := ${CBASE} golang:${GO_VERSION} +GOBASHC := ${CBASE} --entrypoint bash golang:${GO_VERSION} MDGEN_SRC := ${CORSO_REPO}/src/cmd/mdgen/mdgen.go MDGEN_BINARY := ${CORSO_BUILD_BIN}/mdgen CLI_DOCS := ${CORSO_REPO}/website/docs/cli