commit | 5cf931ef8f76dccd0910001d74a58a7fca84a83d | [log] [tgz] |
---|---|---|
author | Guillaume J. Charmes <gcharmes@simplereach.com> | Mon May 11 13:47:10 2015 -0400 |
committer | Guillaume J. Charmes <gcharmes@simplereach.com> | Mon May 11 13:47:10 2015 -0400 |
tree | 51f62df0c99afca4cdd6c1e07c4d506185787142 | |
parent | 8dd5c9d72707d9a7b3e2933c9b96dc2c93b22756 [diff] |
Prevent arm64 file to be compiled anywhere else. Fixed #32.
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) }