func (eo ExpectOpts) Match(v interface{}) Matcher {
	for _, matcher := range eo.Matchers {
		if matcher.Match(v) {
			return matcher
		}
	}
	return nil
}
Match sequentially calls Match on all matchers in ExpectOpts and returns the
first matcher if a match exists, otherwise nil.
package expect
import (
	"bytes"
	"io"
	"os"
	"regexp"
	"strings"
	"syscall"
	"time"
)
type ExpectOpt func(*ExpectOpts) error
func WithTimeout(timeout time.Duration) ExpectOpt {
	return func(opts *ExpectOpts) error {
		opts.ReadTimeout = &timeout
		return nil
	}
}
type ConsoleCallback func(buf *bytes.Buffer) error
func (eo ExpectOpt) Then(f ConsoleCallback) ExpectOpt {
	return func(opts *ExpectOpts) error {
		var options ExpectOpts
		err := eo(&options)
		if err != nil {
			return err
		}
		for _, matcher := range options.Matchers {
			opts.Matchers = append(opts.Matchers, &callbackMatcher{
				f:       f,
				matcher: matcher,
			})
		}
		return nil
	}
}
type ExpectOpts struct {
	Matchers    []Matcher
	ReadTimeout *time.Duration
}