Skip to content

fix: preserve all returns when trailing bool is a flag#307

Merged
ivov merged 1 commit into
mainfrom
preserve-non-presence-bool-returns
May 4, 2026
Merged

fix: preserve all returns when trailing bool is a flag#307
ivov merged 1 commit into
mainfrom
preserve-non-presence-bool-returns

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented May 4, 2026

bytes.Cut, strings.Cut, go/types.LookupFieldOrMethod, and golang.org/x/sync/singleflight.Group.Do now return their full N-tuple rather than collapsing to Option<(T, U)>. The trailing bool on these functions is metadata, not a presence flag, so the prior shape silently discarded values on the most common code path.

import "go:strings"

let (before, after, found) = strings.Cut("hello:world", ":")
if found {
  fmt.Println(before, after)
}

@ivov ivov merged commit 227e61e into main May 4, 2026
22 checks passed
@ivov ivov mentioned this pull request May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Released in lisette-v0.2.0

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