bee icon indicating copy to clipboard operation
bee copied to clipboard

refactor: use the built-in max/min to simplify the code

Open jinjiadu opened this issue 9 months ago • 1 comments

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):

jinjiadu avatar May 24 '25 06:05 jinjiadu

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 avatar Jun 05 '25 14:06 jinjiadu

@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?

gacevicljubisa avatar Jul 29 '25 08:07 gacevicljubisa

@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!

jinjiadu avatar Sep 11 '25 14:09 jinjiadu