Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Go 1.23 #3736

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'v**'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'v**'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'v**'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compatibility-check-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
required: true

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ inputs.base-branch || github.run_id }}-${{ inputs.chain }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compatibility-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
- 'v**'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ inputs.base || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'v**'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
required: true

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.run_id }}-${{ inputs.chain }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
default: 'master'

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
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/onflow/cadence

go 1.22
go 1.23

require (
github.com/bits-and-blooms/bitset v1.5.0
Expand Down
59 changes: 29 additions & 30 deletions interpreter/dynamic_casting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,11 @@ func returnResourceCasted(fromType, targetType string, operation ast.Operation)

func testResourceCastValid(t *testing.T, types, fromType string, targetType string, operation ast.Operation) {
inter := parseCheckAndInterpret(t,
types+
returnResourceCasted(
fromType,
targetType,
operation,
),
types+returnResourceCasted(
fromType,
targetType,
operation,
),
)

value, err := inter.Invoke("test")
Expand Down Expand Up @@ -776,12 +775,10 @@ func testResourceCastValid(t *testing.T, types, fromType string, targetType stri

func testResourceCastInvalid(t *testing.T, types, fromType, targetType string, operation ast.Operation) {
inter := parseCheckAndInterpret(t,
fmt.Sprintf(
types+returnResourceCasted(
fromType,
targetType,
operation,
),
types+returnResourceCasted(
fromType,
targetType,
operation,
),
)

Expand Down Expand Up @@ -886,12 +883,11 @@ func returnStructCasted(fromType, targetType string, operation ast.Operation) st

func testStructCastValid(t *testing.T, types, fromType string, targetType string, operation ast.Operation) {
inter := parseCheckAndInterpret(t,
types+
returnStructCasted(
fromType,
targetType,
operation,
),
types+returnStructCasted(
fromType,
targetType,
operation,
),
)

value, err := inter.Invoke("test")
Expand Down Expand Up @@ -925,13 +921,10 @@ func testStructCastValid(t *testing.T, types, fromType string, targetType string

func testStructCastInvalid(t *testing.T, types, fromType, targetType string, operation ast.Operation) {
inter := parseCheckAndInterpret(t,
fmt.Sprintf(
types+
returnStructCasted(
fromType,
targetType,
operation,
),
types+returnStructCasted(
fromType,
targetType,
operation,
),
)

Expand Down Expand Up @@ -2256,8 +2249,12 @@ func returnReferenceCasted(fromType, targetType string, operation ast.Operation,

func testReferenceCastValid(t *testing.T, types, fromType, targetType string, operation ast.Operation, isResource bool) {
inter := parseCheckAndInterpret(t,
types+
returnReferenceCasted(fromType, targetType, operation, isResource),
types+returnReferenceCasted(
fromType,
targetType,
operation,
isResource,
),
)

value, err := inter.Invoke("test")
Expand Down Expand Up @@ -2309,9 +2306,11 @@ func testReferenceCastValid(t *testing.T, types, fromType, targetType string, op

func testReferenceCastInvalid(t *testing.T, types, fromType, targetType string, operation ast.Operation, isResource bool) {
inter := parseCheckAndInterpret(t,
fmt.Sprintf(
types+
returnReferenceCasted(fromType, targetType, operation, isResource),
types+returnReferenceCasted(
fromType,
targetType,
operation,
isResource,
),
)

Expand Down
5 changes: 4 additions & 1 deletion old_parser/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,10 @@ func parseHexadecimalLocation(p *parser) common.AddressLocation {
address, err := common.BytesToAddress(rawAddress)
if err != nil {
// Any returned error is a syntax error. e.g: Address too large error.
p.reportSyntaxError(err.Error())
p.report(&SyntaxError{
Pos: p.current.StartPos,
Message: err.Error(),
})
}

return common.NewAddressLocation(p.memoryGauge, address, "")
Expand Down
8 changes: 4 additions & 4 deletions old_parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ func (p *parser) next() {
}
parseError, ok := err.(ParseError)
if !ok {
parseError = NewSyntaxError(
token.StartPos,
err.Error(),
)
parseError = &SyntaxError{
Pos: token.StartPos,
Message: err.Error(),
}
}
p.report(parseError)
continue
Expand Down
5 changes: 4 additions & 1 deletion parser/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,10 @@ func parseHexadecimalLocation(p *parser) common.AddressLocation {
address, err := common.BytesToAddress(rawAddress)
if err != nil {
// Any returned error is a syntax error. e.g: Address too large error.
p.reportSyntaxError(err.Error())
turbolent marked this conversation as resolved.
Show resolved Hide resolved
p.report(&SyntaxError{
Pos: p.current.StartPos,
Message: err.Error(),
})
}

return common.NewAddressLocation(p.memoryGauge, address, "")
Expand Down
8 changes: 4 additions & 4 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ func (p *parser) next() {
}
parseError, ok := err.(ParseError)
if !ok {
parseError = NewSyntaxError(
token.StartPos,
err.Error(),
)
parseError = &SyntaxError{
Pos: token.StartPos,
Message: err.Error(),
}
}
p.report(parseError)
continue
Expand Down
Loading
Loading