refactor: use the built-in max/min to simplify the code
Checklist
- [x] I have read the coding guide.
- [ ] My change requires a documentation update, and I have done it.
- [ ] I have added tests to cover my changes.
- [ ] I have filled out the description and linked the related issues.
Description
In Go 1.21, the standard library includes built-in max/min function, which can greatly simplify the code.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):
Based on the error message, it seems that this issue is unrelated to the current modification.
--- FAIL: TestController_UpdateHandler (2.34s)
--- FAIL: TestController_UpdateHandler/add_and_revoke_then_get_from_history (2.06s)
controller_test.go:264:
Error Trace: /home/runner/work/bee/bee/pkg/accesscontrol/controller_test.go:264
Error: Received unexpected error:
access control: not found
Test: TestController_UpdateHandler/add_and_revoke_then_get_from_history
FAIL
FAIL github.com/ethersphere/bee/v2/pkg/accesscontrol 2.552s
@jinjiadu can you merge master branch into yours and push to trigger the workflow that we can merge it? Or make some minor additional changes?
@jinjiadu can you merge master branch into yours and push to trigger the workflow that we can merge it? Or make some minor additional changes?
Thanks for your reply. @gacevicljubisa @nugaon @martinconic I have update the latest code. Please review again when you have time!