Skip to content

refactor: replace golang.org/x/exp with stdlib#4576

Merged
dustinxie merged 1 commit intoiotexproject:masterfrom
TechVest:master
Mar 13, 2025
Merged

refactor: replace golang.org/x/exp with stdlib#4576
dustinxie merged 1 commit intoiotexproject:masterfrom
TechVest:master

Conversation

@TechVest
Copy link
Contributor

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.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

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

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

Signed-off-by: TechVest <techdashen@qq.com>
@CLAassistant
Copy link

CLAassistant commented Mar 10, 2025

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link

@envestcc envestcc requested a review from Copilot March 11, 2025 02:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 dustinxie merged commit 7510ace into iotexproject:master Mar 13, 2025
4 checks passed
CoderZhi pushed a commit that referenced this pull request Mar 29, 2025
Signed-off-by: TechVest <techdashen@qq.com>
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.

5 participants