Skip to content

make set.NewSet initializable - #5

Merged
keroxp merged 1 commit into
mainfrom
set-init
Jan 27, 2026
Merged

make set.NewSet initializable#5
keroxp merged 1 commit into
mainfrom
set-init

Conversation

@keroxp

@keroxp keroxp commented Jan 27, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the generic set.NewSet constructor accept initial values while updating the Go toolchain and CI configuration.

Changes:

  • Update NewSet[T] to accept a variadic list of initial values and populate the underlying sync.Map via Add.
  • Add tests covering NewSet initialization behavior (empty, with values, duplicates, and different types) and refactor internal sync.Map.Range callbacks to use any.
  • Bump the module’s Go version to 1.25 and update the GitHub Actions workflow to use newer action versions and Go 1.25.x.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
set/set.go Extends NewSet to accept initial values and modernizes Range callback parameter types to any.
set/set_test.go Adds comprehensive tests validating NewSet initialization semantics for ints and strings, including deduplication.
go.mod Updates the declared Go version to 1.25 to align with the updated CI Go toolchain.
.github/workflows/push.yml Refreshes CI configuration to use ubuntu-latest, newer checkout/setup-go actions, and Go 1.25.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@keroxp
keroxp merged commit 84dea6d into main Jan 27, 2026
7 checks passed
@keroxp
keroxp deleted the set-init branch January 27, 2026 09:14
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.

2 participants