Skip to content

Commit 7d5e09b

Browse files
committed
Require Go 1.21+
1 parent f53276d commit 7d5e09b

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
- macOS
1212
- Windows
1313
go-version:
14-
- '1.20'
1514
- '1.21'
1615
- '1.22'
16+
- '1.23'
1717
include:
1818
- platform: Linux
1919
os: ubuntu-latest

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/hattya/go.sh
22

3-
go 1.20
3+
go 1.21

Diff for: interp/lexer.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// go.sh/interp :: lexer.go
33
//
4-
// Copyright (c) 2021 Akinori Hattori <[email protected]>
4+
// Copyright (c) 2021-2024 Akinori Hattori <[email protected]>
55
//
66
// SPDX-License-Identifier: MIT
77
//
@@ -13,6 +13,7 @@ package interp
1313
import (
1414
"fmt"
1515
"io"
16+
"runtime"
1617
"strings"
1718
"sync"
1819
"unicode"
@@ -98,7 +99,9 @@ func (l *lexer) run() {
9899
defer func() {
99100
close(l.token)
100101

101-
if e := recover(); e != nil {
102+
switch e := recover().(type) {
103+
case nil, *runtime.PanicNilError:
104+
default:
102105
// re-panic
103106
panic(e)
104107
}

Diff for: parser/lexer.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// go.sh/parser :: lexer.go
33
//
4-
// Copyright (c) 2018-2021 Akinori Hattori <[email protected]>
4+
// Copyright (c) 2018-2024 Akinori Hattori <[email protected]>
55
//
66
// SPDX-License-Identifier: MIT
77
//
@@ -16,6 +16,7 @@ import (
1616
"errors"
1717
"fmt"
1818
"io"
19+
"runtime"
1920
"strings"
2021
"sync"
2122
"sync/atomic"
@@ -136,7 +137,9 @@ func (l *lexer) run() {
136137
close(l.done)
137138
}
138139

139-
if e := recover(); e != nil {
140+
switch e := recover().(type) {
141+
case nil, *runtime.PanicNilError:
142+
default:
140143
// re-panic
141144
panic(e)
142145
}

0 commit comments

Comments
 (0)