Skip to content

Commit

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

Co-authored-by: Prashant V <[email protected]>
  • Loading branch information
cbandy and prashantv committed Nov 16, 2024
1 parent d96f0d1 commit 8fad5b3
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 42 deletions.
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")

Check warning on line 312 in cmd/errtrace/toolexec.go

View check run for this annotation

Codecov / codecov/patch

cmd/errtrace/toolexec.go#L312

Added line #L312 was not covered by tests
}

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 8fad5b3

Please sign in to comment.