INNER CODE UNIT · Go

RegexpPattern

Netflix/go-expect · expect_opt.go:271

func RegexpPattern(ps ...string) ExpectOpt {
	return func(opts *ExpectOpts) error {
		var res []*regexp.Regexp
		for _, p := range ps {
			re, err := regexp.Compile(p)
			if err != nil {
				return err
			}
			res = append(res, re)
		}
		return Regexp(res...)(opts)
	}
}

// Error adds an Expect condition to exit if reading from Console's tty returns
// one of the provided errors.
func Error(errs ...error) ExpectOpt {
	return func(opts *ExpectOpts) error {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…