# tmuxq.ExactlyOne

- **Module:** tmuxq
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmuxq/query.go#L53
- **Page:** https://libtmux.org/reference/go/tmuxq-exactlyone/

```
tmuxq.ExactlyOne(values: []T, predicate: func(*T) bool) -> (T, error)
```

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].
