From cdde64b6f24320e95c821e08aaef5550543de46c Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Thu, 21 Sep 2023 17:25:58 -0500 Subject: [PATCH] circleci right go version --- .circleci/config.yml | 6 +++--- .circleci/gen.go | 14 +++++++++++++- go.mod | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad6323a2f..ccf133fe9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,7 +164,7 @@ jobs: default: unit description: Test suite name to report to CircleCI. docker: - - image: cimg/go:1.19.7 + - image: cimg/go:1.20.7 environment: LOTUS_HARMONYDB_HOSTS: yugabyte - image: yugabytedb/yugabyte:latest @@ -218,7 +218,7 @@ jobs: test with. If empty (the default) the commit defined by the git submodule is used. docker: - - image: cimg/go:1.19.7 + - image: cimg/go:1.20.7 resource_class: << parameters.resource_class >> steps: - install-ubuntu-deps @@ -412,7 +412,7 @@ jobs: description: | Arguments to pass to golangci-lint docker: - - image: cimg/go:1.19.7 + - image: cimg/go:1.20.7 resource_class: medium+ steps: - install-ubuntu-deps diff --git a/.circleci/gen.go b/.circleci/gen.go index 5e89738a6..19329247a 100644 --- a/.circleci/gen.go +++ b/.circleci/gen.go @@ -10,13 +10,25 @@ import ( "text/template" ) -const GoVersion = "1.19.7" +var GoVersion = "" // from init below. Ex: 1.19.7 //go:generate go run ./gen.go .. //go:embed template.yml var templateFile embed.FS +func init() { + b, err := os.ReadFile("../go.mod") + if err != nil { + panic("cannot find go.mod in parent folder") + } + for _, line := range strings.Split(string(b), "\n") { + if strings.HasPrefix(line, "go ") { + GoVersion = line[3:] + } + } +} + type ( dirs = []string suite = string diff --git a/go.mod b/go.mod index bee576e27..f4b31f296 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/filecoin-project/lotus -go 1.19 +go 1.20.7 retract v1.14.0 // Accidentally force-pushed tag, use v1.14.1+ instead.