clipboard
clipboard copied to clipboard
Stdout already set error in macos
I'm using osx 10.9.5, and following snippet gives a strange output:
package main
import (
"fmt";
"github.com/robertknight/clipboard";
"time";
)
func main() {
for {
s, err := clipboard.ReadAll();
if err != nil {
fmt.Printf("%s\n", err);
}
fmt.Printf("%s\n", s);
time.Sleep(1000 * time.Millisecond);
}
}
it prints: whatever in clipboard exec: Stdout already set exec: Stdout already set ...
how can I fix this?
Hi,
I cannot reproduce it on my osx 10.9.5(go version go1.6.2 darwin/amd64
) and 10.11.4(go version go1.6 darwin/amd64
).
What version of Go are you using (go version
)?
Maybe the error is coming from https://golang.org/src/os/exec/exec.go#L420 .
Thanks.
P.S.
I use the following code:
package main
import (
"fmt"
"time"
"github.com/atotto/clipboard"
)
func main() {
for {
s, err := clipboard.ReadAll()
if err != nil {
fmt.Printf("%s\n", err)
}
fmt.Printf("%s\n", s)
time.Sleep(1000 * time.Millisecond)
}
}