Update to go1.19 for corso (#1632)

## Description

Required as some third party libraries are now requiring 1.19.

## Type of change

- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🐹 Trivial/Minor

## Issue(s)

* closes #1629 

## Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-12-13 13:01:55 -08:00 committed by GitHub
parent 8442175a5d
commit 865edac9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 16 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.18-alpine as builder FROM golang:1.19-alpine as builder
WORKDIR /go/src/app WORKDIR /go/src/app
COPY src . COPY src .

View File

@ -12,7 +12,7 @@ usage() {
} }
ROOT=$(dirname $(dirname $(readlink -f $0))) ROOT=$(dirname $(dirname $(readlink -f $0)))
GOVER=1.18 # go version GOVER=1.19 # go version
CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache
# Figure out os and architecture # Figure out os and architecture

View File

@ -4,7 +4,7 @@
# It is not used for deployments. # It is not used for deployments.
## Build ## Build
FROM golang:1.18 AS base FROM golang:1.19 AS base
WORKDIR /src WORKDIR /src

View File

@ -2,7 +2,6 @@ package config
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
@ -53,7 +52,7 @@ func (suite *ConfigSuite) TestReadRepoConfigBasic() {
// Generate test config file // Generate test config file
testConfigData := fmt.Sprintf(configFileTemplate, b, tID) testConfigData := fmt.Sprintf(configFileTemplate, b, tID)
testConfigFilePath := filepath.Join(t.TempDir(), "corso.toml") 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) require.NoError(t, err)
// Configure viper to read test config file // Configure viper to read test config file

View File

@ -1,6 +1,6 @@
module github.com/alcionai/corso/src module github.com/alcionai/corso/src
go 1.18 go 1.19
require ( require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0

View File

@ -3,7 +3,6 @@ package mockconnector_test
import ( import (
"bytes" "bytes"
"io" "io"
"io/ioutil"
"testing" "testing"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
@ -30,7 +29,7 @@ func (suite *MockExchangeCollectionSuite) TestMockExchangeCollection() {
messagesRead := 0 messagesRead := 0
for item := range mdc.Items() { for item := range mdc.Items() {
_, err := ioutil.ReadAll(item.ToReader()) _, err := io.ReadAll(item.ToReader())
assert.NoError(suite.T(), err) assert.NoError(suite.T(), err)
messagesRead++ 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") mdc.Data[1] = []byte("This is some buffer of data so that the size is different than the default")
for item := range mdc.Items() { for item := range mdc.Items() {
buf, err := ioutil.ReadAll(item.ToReader()) buf, err := io.ReadAll(item.ToReader())
assert.NoError(t, err) assert.NoError(t, err)
assert.Implements(t, (*data.StreamSize)(nil), item) assert.Implements(t, (*data.StreamSize)(nil), item)
@ -110,7 +109,7 @@ func (suite *MockExchangeDataSuite) TestMockExchangeData() {
for _, test := range table { for _, test := range table {
suite.T().Run(test.name, func(t *testing.T) { suite.T().Run(test.name, func(t *testing.T) {
assert.Equal(t, id, test.reader.UUID()) 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) test.check(t, err)
if err != nil { if err != nil {

View File

@ -3,7 +3,6 @@ package kopia
import ( import (
"bytes" "bytes"
"io" "io"
"io/ioutil"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@ -100,7 +99,7 @@ func (suite *KopiaDataCollectionUnitSuite) TestReturnsStreams() {
assert.Equal(t, returnedStream.UUID(), uuids[count]) assert.Equal(t, returnedStream.UUID(), uuids[count])
buf, err := ioutil.ReadAll(returnedStream.ToReader()) buf, err := io.ReadAll(returnedStream.ToReader())
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, buf, testData[count]) assert.Equal(t, buf, testData[count])
require.Implements(t, (*data.StreamSize)(nil), returnedStream) require.Implements(t, (*data.StreamSize)(nil), returnedStream)

View File

@ -4,7 +4,6 @@ import (
"bytes" "bytes"
"context" "context"
"io" "io"
"io/ioutil"
stdpath "path" stdpath "path"
"testing" "testing"
@ -68,7 +67,7 @@ func testForFiles(
expected, ok := expected[fullPath.String()] expected, ok := expected[fullPath.String()]
require.True(t, ok, "unexpected file with path %q", fullPath) 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) require.NoError(t, err, "reading collection item: %s", fullPath)
assert.Equal(t, expected, buf, "comparing collection item: %s", fullPath) assert.Equal(t, expected, buf, "comparing collection item: %s", fullPath)

View File

@ -1,5 +1,6 @@
.PHONY: buildimage build dev shell check genclidocs _validatemdgen publish sync .PHONY: buildimage build dev shell check genclidocs _validatemdgen publish sync
GO_VERSION := 1.19
CORSO_BUILD_DIR := /tmp/.corsobuild CORSO_BUILD_DIR := /tmp/.corsobuild
CORSO_BUILD_CACHE := ${CORSO_BUILD_DIR}/cache CORSO_BUILD_CACHE := ${CORSO_BUILD_DIR}/cache
CORSO_BUILD_MOD := ${CORSO_BUILD_DIR}/mod 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} \ -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} \ --env GOCACHE=${CORSO_BUILD_CACHE} --env GOMODCACHE=${CORSO_BUILD_MOD} --env GOTMPDIR=${CORSO_BUILD_DIR} \
--workdir ${CORSO_REPO}/src --workdir ${CORSO_REPO}/src
GOC := ${CBASE} golang:1.18 GOC := ${CBASE} golang:${GO_VERSION}
GOBASHC := ${CBASE} --entrypoint bash golang:1.18 GOBASHC := ${CBASE} --entrypoint bash golang:${GO_VERSION}
MDGEN_SRC := ${CORSO_REPO}/src/cmd/mdgen/mdgen.go MDGEN_SRC := ${CORSO_REPO}/src/cmd/mdgen/mdgen.go
MDGEN_BINARY := ${CORSO_BUILD_BIN}/mdgen MDGEN_BINARY := ${CORSO_BUILD_BIN}/mdgen
CLI_DOCS := ${CORSO_REPO}/website/docs/cli CLI_DOCS := ${CORSO_REPO}/website/docs/cli