-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
* updated linter, test tool version * updated linter configuration * replace slices.Sort with sort.Slice * updated go deps
070ffdc
to
2929dcd
Compare
cpa/tester/test.go
Outdated
@@ -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 }) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
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 |
There was a problem hiding this comment.
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
Rationale
Update dependencies mostly, but at the same time let's update the tooling used and Go version.
Changes