Registry / testing / netflix-go-expect

netflix-go-expect

JSON →
library0.0.0-20220104043353-73e0943537d2gogounverified

An expect-like interface to automate control of applications by expecting output and sending input through a pseudoterminal.

go get github.com/Netflix/go-expect
INSTALL
IMPORT
SIG · NETFLIX-GO-EXPECT
N
netflix-go-expect
testinggov0.0.0-20220104043353-73e0943537d2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

expect
github.com/Netflix/go-expect

Creates a console, runs a command, and expects output.

package main import ( "fmt" "os/exec" "github.com/Netflix/go-expect" ) func main() { c, err := expect.NewConsole(expect.WithStdout(os.Stdout)) if err != nil { panic(err) } defer c.Close() cmd := exec.Command("echo", "hello") cmd.Stdin = c.Tty() cmd.Stdout = c.Tty() cmd.Stderr = c.Tty() go func() { c.ExpectString("hello") fmt.Println("matched") }() cmd.Run() }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20220104043353-73e0943537d2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
netflix-go-expect — go get netflix-go-expect · libregistry