commit | 98c7b800832d8aaa5ab1362ba0f19eea291900d9 | [log] [tgz] |
---|---|---|
author | Keith Rarick <kr@xph.us> | Tue Mar 04 20:22:29 2014 -0800 |
committer | Keith Rarick <kr@xph.us> | Tue Mar 04 20:22:29 2014 -0800 |
tree | bc777be4e513ea8e0f1338ca2fb8c243fb6ef6b6 | |
parent | 7a543c8bf642969b4b225984bfa7d88a0b737a11 [diff] |
define public symbols without build constraints
Pty is a Go package for using unix pseudo-terminals.
go get github.com/kr/pty
package main import ( "github.com/kr/pty" "io" "os" "os/exec" ) func main() { c := exec.Command("grep", "--color=auto", "bar") f, err := pty.Start(c) if err != nil { panic(err) } go func() { f.Write([]byte("foo\n")) f.Write([]byte("bar\n")) f.Write([]byte("baz\n")) f.Write([]byte{4}) // EOT }() io.Copy(os.Stdout, f) }