Skip to content

Commit

Permalink
add Go 1.19.x, drop 1.17.x
Browse files Browse the repository at this point in the history
While here, some tiny cleanups thanks to the version bump.
  • Loading branch information
mvdan committed Aug 3, 2022
1 parent 0ccfaad commit b00be20
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 628 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x]
go-version: [1.18.x, 1.19.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -25,18 +25,17 @@ jobs:

# Static checks from this point forward. Only run on one Go version and on
# Linux, since it's the fastest platform, and the tools behave the same.
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.19.x'
run: diff <(echo -n) <(gofmt -s -d .)
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.19.x'
run: go vet ./...

test-linux-alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test as root, without cgo, and with busybox
# Note -buildvcs=false since Go's alpine images lack git.
run: docker run -v="$PWD:/pwd" -w=/pwd -e=CGO_ENABLED=0 golang:1.18.0-alpine go test -buildvcs=false ./...
run: docker run -v="$PWD:/pwd" -w=/pwd -e=CGO_ENABLED=0 golang:1.19.0-alpine go test ./...

docker:
name: Build and test Docker images
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Go Reference](https://pkg.go.dev/badge/mvdan.cc/sh/v3.svg)](https://pkg.go.dev/mvdan.cc/sh/v3)

A shell parser, formatter, and interpreter. Supports [POSIX Shell], [Bash], and
[mksh]. Requires Go 1.17 or later.
[mksh]. Requires Go 1.18 or later.

### Quick start

Expand Down Expand Up @@ -37,7 +37,7 @@ POSIX shell at the moment, and its options are intentionally minimalistic.

### Fuzzing

We use Go's native fuzzing support, which requires Go 1.18 or later. For instance:
We use Go's native fuzzing support. For instance:

cd syntax
go test -run=- -fuzz=ParsePrint
Expand Down
18 changes: 1 addition & 17 deletions _js/go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
module shjs

go 1.17
go 1.18

replace mvdan.cc/sh/v3 => ../

require (
github.com/gopherjs/gopherjs v1.17.2
mvdan.cc/sh/v3 v3.0.0-00010101000000-000000000000
)

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 // indirect
github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cobra v1.2.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/tools v0.1.5 // indirect
)
591 changes: 6 additions & 585 deletions _js/go.sum

Large diffs are not rendered by default.

18 changes: 1 addition & 17 deletions fileutil/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,7 @@ const (
//
// Deprecated: prefer CouldBeScript2, which usually requires fewer syscalls.
func CouldBeScript(info os.FileInfo) ScriptConfidence {
// TODO: once we drop support for Go 1.16,
// make use of this Go 1.17 API instead:
// return CouldBeScript2(fs.FileInfoToDirEntry(info))

name := info.Name()
switch {
case info.IsDir(), name[0] == '.':
return ConfNotScript
case info.Mode()&os.ModeSymlink != 0:
return ConfNotScript
case extRe.MatchString(name):
return ConfIsScript
case strings.IndexByte(name, '.') > 0:
return ConfNotScript // different extension
default:
return ConfIfShebang
}
return CouldBeScript2(fs.FileInfoToDirEntry(info))
}

// CouldBeScript2 reports how likely a directory entry is to be a shell script.
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 mvdan.cc/sh/v3

go 1.17
go 1.18

require (
github.com/creack/pty v1.1.17
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
Expand Down

0 comments on commit b00be20

Please sign in to comment.