Skip to content

Simplify some code with slices and for-range.#1237

Open
atombrella wants to merge 1 commit intocontainernetworking:mainfrom
atombrella:feature/modernize_update
Open

Simplify some code with slices and for-range.#1237
atombrella wants to merge 1 commit intocontainernetworking:mainfrom
atombrella:feature/modernize_update

Conversation

@atombrella
Copy link

I applied a few of the modernize rules to simplify the code slightly:

  • slices.Contains removes some chunks of iterations that do exactly what can be leveraged to slices.Contains
  • for range N which is syntactic sugar.
  • A single // +build which definitely needs to go.
  • slices.Sort instead of sort.Slice.

The golangci-lint version is a bit old, and I didn't want to tamper around with it in this PR.

@atombrella atombrella force-pushed the feature/modernize_update branch from fa75f5b to afa7a75 Compare March 8, 2026 21:10
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
@atombrella atombrella force-pushed the feature/modernize_update branch from afa7a75 to 2d7d599 Compare March 8, 2026 21:35
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.

1 participant