refactor: replace golang.org/x/exp with stdlib#4576
Merged
dustinxie merged 1 commit intoiotexproject:masterfrom Mar 13, 2025
Merged
refactor: replace golang.org/x/exp with stdlib#4576dustinxie merged 1 commit intoiotexproject:masterfrom
dustinxie merged 1 commit intoiotexproject:masterfrom
Conversation
Signed-off-by: TechVest <techdashen@qq.com>
|
envestcc
approved these changes
Mar 11, 2025
There was a problem hiding this comment.
PR Overview
This PR refactors the codebase to replace the deprecated "golang.org/x/exp/slices" package with the Go 1.21 standard library "slices" package. The update spans production and test files to ensure all slice-related functionality uses the up-to-date standard library implementation.
- Updated imports in production code (nodeinfo/manager.go and ioctl/cmd/bc/bcdelegate.go)
- Updated imports in test files (action/protocol/staking_statereader_test.go, e2etest/contract_staking_test.go, blockindex/contractstaking/indexer_test.go)
Reviewed Changes
| File | Description |
|---|---|
| nodeinfo/manager.go | Replaced the deprecated "golang.org/x/exp/slices" with the standard library "slices" |
| action/protocol/staking_statereader_test.go | Updated slice imports to use stdlib "slices" |
| e2etest/contract_staking_test.go | Updated slice imports to use stdlib "slices" |
| blockindex/contractstaking/indexer_test.go | Updated slice imports to use stdlib "slices" |
| ioctl/cmd/bc/bcdelegate.go | Updated slice imports to use stdlib "slices" |
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
dustinxie
approved these changes
Mar 13, 2025
CoderZhi
pushed a commit
that referenced
this pull request
Mar 29, 2025
Signed-off-by: TechVest <techdashen@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Since Go 1.21, the functions in x/exp used here can already be replaced by functions from the standard library.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: