Skip to content

fix(package): [random] handle non-positive unique slice lengths - #402

Merged
duke-git merged 1 commit into
duke-git:rcfrom
yuefdev:fix/random-negative-slice-lengths-sol
Oct 22, 2026
Merged

duke-git merged 1 commit into
duke-git:rcfrom
yuefdev:fix/random-negative-slice-lengths-sol

Conversation

@yuefdev

@yuefdev yuefdev commented Oct 18, 2026

Copy link
Copy Markdown

Handle non-positive lengths in the two unique random-slice helpers before allocating. This matches RandIntSlice, RandBoolSlice and RandStringSlice; negative requests currently panic.

The regression panics before the fix. Random tests, vet and gofmt pass on Windows/Go 1.27.0, covering zero and negative lengths. The repository-wide test command encounters unrelated existing Windows/process/crypto fixture failures.

@duke-git
duke-git merged commit 19ccb13 into duke-git:rc Oct 22, 2026
1 check passed
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