Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Go 1.21 polyfills #118

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

// 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.

Loading