Skip to content

Commit

Permalink
Remove Go 1.21 polyfills (#118)
Browse files Browse the repository at this point in the history
We can drop these now that the main module requires Go 1.21.

See:
- #111

---------

Co-authored-by: Prashant V <github@prashantv.com>
  • Loading branch information
cbandy and prashantv authored Nov 17, 2024
1 parent 39cae41 commit 3cfecaa
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 43 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
permissions:
contents: read

env:
# Use the Go toolchain installed by setup-go
# https://github.com/actions/setup-go/issues/457
GOTOOLCHAIN: local

jobs:

test:
Expand Down Expand Up @@ -86,7 +91,7 @@ jobs:
- uses: actions/setup-go@v5
name: Set up Go
with:
# Use the Go version specified in the go.mod for linting.
# Use the Go language version in go.mod for linting.
go-version-file: go.mod
cache: false # managed by golangci-lint

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Example: `go build -toolexec="errtrace -required-packages pkg/..." pkg/to/build`

### Changed
- Update `go` directive in go.mod to 1.21.
- Update `go` directive in go.mod to 1.21, and drop compatibility with Go 1.20 and earlier.

### Fixed
- cmd/errtrace: Don't exit with a non-zero status when `-h` is used.
Expand Down
9 changes: 0 additions & 9 deletions cmd/errtrace/slices_contains_go121.go

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/errtrace/slices_contains_pre_go121.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/errtrace/toolexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func readBuildSHA() (_ string, ok bool) {

// isStdLib checks if the current execution is for stdlib.
func isStdLib(args []string) bool {
return slicesContains(args, "-std")
return slices.Contains(args, "-std")
}

func packageSelectorMatch(selector, importPath string) bool {
Expand Down
3 changes: 2 additions & 1 deletion tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"runtime"
"slices"
"strings"
)

Expand Down Expand Up @@ -72,7 +73,7 @@ loop:
}
}

sliceReverse(current.Trace)
slices.Reverse(current.Trace)
return current
}

Expand Down
9 changes: 0 additions & 9 deletions tree_go121.go

This file was deleted.

9 changes: 0 additions & 9 deletions tree_pre_go121.go

This file was deleted.

0 comments on commit 3cfecaa

Please sign in to comment.