Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux-go latest

ExactlyOne

ExactlyOne returns a shallow copy when exactly one source-ordered value is accepted by predicate. It examines values until source exhaustion confirms a sole match, or stops at the second match. It returns the zero value of T with ErrNoMatch for no matches or ErrMultipleMatches for multiple matches; callers can classify either error with errors.Is.

Source and package
Qualified name
tmuxq.ExactlyOne
Package
tmuxq
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmuxq/query.go
func ExactlyOne[T any]( values []T, predicate func(*T) bool, ) (T, error)
Type parameters
Parameters

Guides#

Pages that discuss ExactlyOne.

Esc

Type to search.

Reference previewOpen reference