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

[SECENG] Update dependencies and config #125

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

vallieres
Copy link
Contributor

Rationale

Update dependencies mostly, but at the same time let's update the tooling used and Go version.

Changes

  • updated to Go 1.23.1
  • updated linter, test tool version
  • updated linter configuration
  • replace slices.Sort with sort.Slice
  • updated go deps

* updated linter, test tool version
* updated linter configuration
* replace slices.Sort with sort.Slice
* updated go deps
@vallieres vallieres force-pushed the SECENG_update-dependencies-config branch from 070ffdc to 2929dcd Compare September 26, 2024 15:45
@vallieres vallieres marked this pull request as ready for review September 26, 2024 15:52
@vallieres vallieres requested a review from a team as a code owner September 26, 2024 15:52
@vallieres vallieres changed the title [SECENG] Update depenencies and config [SECENG] Update dependencies and config Oct 24, 2024
@@ -25,7 +25,8 @@ func (t Test) NamedCases() []NamedTest {
for name, test := range t.Cases {
result = append(result, NamedTest{name, test})
}
slices.SortFunc(result, func(a, b NamedTest) bool { return a.Name < b.Name })
sort.Slice(result, func(i, j int) bool { return result[i].Name < result[j].Name })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is actually a standard lib slices package now, https://pkg.go.dev/slices#SortFunc. We might want to just swap to that dependency? Then we wouldn't need to change this I think?

I suggest it only because of this snippet from the sort package doc:

Note: in many situations, the newer [slices.SortFunc](https://pkg.go.dev/slices#SortFunc) function is more ergonomic and runs faster.

doc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, could you do the same in cpa/tester/runner.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@vallieres vallieres requested a review from moses-001 December 2, 2024 20:31
@vallieres vallieres requested a review from okmoses December 9, 2024 16:12
go.mod Outdated
github.com/open-policy-agent/opa v0.68.0
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrt @moses-001 comment - I think if we replace the other usages we could avoid this import completely

@vallieres vallieres merged commit 07cd8d9 into main Dec 10, 2024
3 checks passed
@vallieres vallieres deleted the SECENG_update-dependencies-config branch December 10, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants