Skip to content

Commit 936bd2e

Browse files
authored
Merge pull request #1379 from kolyshkin/v1-fix-ci
[v1] fix CI, add Go 1.17.x and 1.18.x
2 parents 1b4a05e + 6564c0f commit 936bd2e

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/cli.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest, macos-latest]
18-
go:
19-
- 1.16.x
20-
# NOTE: tests fail with panic at
21-
# TestApp_RunAsSubCommandIncorrectUsage on these
22-
# versions:
23-
# - 1.17.x
24-
# - 1.18.x
18+
go: [1.16.x, 1.17.x, 1.18.x]
2519
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
2620
runs-on: ${{ matrix.os }}
2721
steps:
@@ -38,6 +32,6 @@ jobs:
3832

3933
- name: Run Tests
4034
run:
41-
go run build.go vet &&
42-
go run build.go test &&
35+
go run build.go vet
36+
go run build.go test
4337
go run build.go toc docs/v1/manual.md

app_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,14 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
508508
}
509509

510510
func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
511+
// Go 1.17+ panics when invalid flag is given.
512+
// Catch it here and consider the test passed.
513+
defer func() {
514+
if err := recover(); err == nil {
515+
t.Fatal("expected error, got nothing")
516+
}
517+
}()
518+
511519
a := App{
512520
Flags: []Flag{
513521
StringFlag{Name: "--foo"},

0 commit comments

Comments
 (0)