diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faeb34f1ef..8edffc9738 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - go-version: '1.25' + go-version: '1.26' cache: true - name: Build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0ba2f42694..4a25310c07 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: '1.25' + go-version: '1.26' cache: true - name: Initialize CodeQL diff --git a/bbq/compiler/compiler.go b/bbq/compiler/compiler.go index 8696dc5b12..722c2af3be 100644 --- a/bbq/compiler/compiler.go +++ b/bbq/compiler/compiler.go @@ -298,7 +298,7 @@ func (c *Compiler[E, _]) addGlobal(name string, kind bbq.GlobalKind) bbq.Global case bbq.GlobalKindContract: global = bbq.NewContractGlobal(c.Config.MemoryGauge, name, nil, uint16(count)) default: - panic(errors.NewDefaultUserError("unsupported global kind %#q", kind)) + panic(errors.NewDefaultUserError("unsupported global kind %#q", kind.String())) } c.Globals[name] = global diff --git a/bbq/global.go b/bbq/global.go index 689d450c65..9b73a4911d 100644 --- a/bbq/global.go +++ b/bbq/global.go @@ -22,6 +22,8 @@ import ( "github.com/onflow/cadence/common" ) +//go:generate stringer -type=GlobalKind + type GlobalKind int const ( diff --git a/bbq/globalkind_string.go b/bbq/globalkind_string.go new file mode 100644 index 0000000000..c9d723c560 --- /dev/null +++ b/bbq/globalkind_string.go @@ -0,0 +1,26 @@ +// Code generated by "stringer -type=GlobalKind"; DO NOT EDIT. + +package bbq + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[GlobalKindFunction-0] + _ = x[GlobalKindVariable-1] + _ = x[GlobalKindContract-2] + _ = x[GlobalKindImported-3] +} + +const _GlobalKind_name = "GlobalKindFunctionGlobalKindVariableGlobalKindContractGlobalKindImported" + +var _GlobalKind_index = [...]uint8{0, 18, 36, 54, 72} + +func (i GlobalKind) String() string { + if i < 0 || i >= GlobalKind(len(_GlobalKind_index)-1) { + return "GlobalKind(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _GlobalKind_name[_GlobalKind_index[i]:_GlobalKind_index[i+1]] +} diff --git a/go.mod b/go.mod index c7a4c6b77c..ceb95d964e 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/onflow/cadence -go 1.24.0 - -toolchain go1.24.3 +go 1.26.0 require ( github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc diff --git a/tools/accounts-script/go.mod b/tools/accounts-script/go.mod index ca84ab36cd..ecb75e15b1 100644 --- a/tools/accounts-script/go.mod +++ b/tools/accounts-script/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/accounts-script -go 1.24 +go 1.26 require ( github.com/ethereum/go-ethereum v1.13.10 diff --git a/tools/compatibility-check/go.mod b/tools/compatibility-check/go.mod index 5e0bb00ad9..0b60837ead 100644 --- a/tools/compatibility-check/go.mod +++ b/tools/compatibility-check/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/compatibility_check -go 1.25.0 +go 1.26.0 require ( github.com/onflow/cadence v1.8.6 diff --git a/tools/constructorcheck/go.mod b/tools/constructorcheck/go.mod index 7f09628c31..ad4f4dc947 100644 --- a/tools/constructorcheck/go.mod +++ b/tools/constructorcheck/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/constructorcheck -go 1.24 +go 1.26 require golang.org/x/tools v0.32.0 diff --git a/tools/get-contracts/go.mod b/tools/get-contracts/go.mod index eb7e7f93e9..7895199e37 100644 --- a/tools/get-contracts/go.mod +++ b/tools/get-contracts/go.mod @@ -1,3 +1,3 @@ module github.com/onflow/cadence/tools/get-contracts -go 1.24 +go 1.26 diff --git a/tools/go-apply-expr-diff/go.mod b/tools/go-apply-expr-diff/go.mod index 63ea333d8a..94512ab660 100644 --- a/tools/go-apply-expr-diff/go.mod +++ b/tools/go-apply-expr-diff/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/go-apply-expr-diff -go 1.24 +go 1.26 require ( github.com/dave/dst v0.27.3 diff --git a/tools/golangci-lint/go.mod b/tools/golangci-lint/go.mod index 6a76be6171..14925f884d 100644 --- a/tools/golangci-lint/go.mod +++ b/tools/golangci-lint/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/golangci-lint -go 1.24 +go 1.26 require github.com/golangci/golangci-lint/v2 v2.1.6 diff --git a/tools/maprange/go.mod b/tools/maprange/go.mod index 50ecaa72d4..22b4bb526c 100644 --- a/tools/maprange/go.mod +++ b/tools/maprange/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/maprange -go 1.24 +go 1.26 require golang.org/x/tools v0.32.0 diff --git a/tools/storage-explorer/go.mod b/tools/storage-explorer/go.mod index 03f9bd4300..19aad65e4d 100644 --- a/tools/storage-explorer/go.mod +++ b/tools/storage-explorer/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/storage-explorer -go 1.23 +go 1.26 require ( github.com/gorilla/mux v1.8.1 diff --git a/tools/unkeyed/go.mod b/tools/unkeyed/go.mod index 0fb5b76b4a..0a4310f7e9 100644 --- a/tools/unkeyed/go.mod +++ b/tools/unkeyed/go.mod @@ -1,6 +1,6 @@ module github.com/onflow/cadence/tools/unkeyed -go 1.24 +go 1.26 require ( golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac