# tmuxq.ExactlyOneSeq

- **Module:** tmuxq
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmuxq/query.go#L112
- **Page:** https://libtmux.org/en/go/latest/reference/tmuxq-exactlyoneseq/

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

ExactlyOneSeq returns a shallow copy when exactly one source-ordered sequence value is accepted by predicate. It stops pulling at the second match. If input ends with no matches, it returns the zero value of T with [ErrNoMatch]; if it finds a second match, it returns the zero value of T with [ErrMultipleMatches]. Callers can classify either error with [errors.Is]. With an infinite input, ExactlyOneSeq returns only after a second match; it cannot confirm a no-match or exactly-one result without source exhaustion.
