INNER CODE UNIT · Go
WithTimeout
Netflix/go-expect · expect_opt.go:31
func WithTimeout(timeout time.Duration) ExpectOpt {
return func(opts *ExpectOpts) error {
opts.ReadTimeout = &timeout
return nil
}
}
// ConsoleCallback is a callback function to execute if a match is found for
// the chained matcher.
type ConsoleCallback func(buf *bytes.Buffer) error
// Then returns an Expect condition to execute a callback if a match is found
// for the chained matcher.
func (eo ExpectOpt) Then(f ConsoleCallback) ExpectOpt {
return func(opts *ExpectOpts) error {
var options ExpectOpts
err := eo(&options)
if err != nil {