delve/_fixtures/cat.go
aarzilli 6ab6929b9a proc/gdbserial: fix redirect bugs with debugserver
1. Forward stdin/stdout/stderr to the target process when in foreground
   mode instead of always forwarding the current tty (issue #1964)
2. When redirecting a file descriptor make sure to also specify
   something for all three otherwise debugserver will misbehave (either
   exit on launch or run but giving the target process a closed file
   descriptor).

Fixes #1964
2020-11-17 16:00:22 +01:00

16 lines
171 B
Go

package main
import (
"bufio"
"fmt"
"os"
)
func main() {
s := bufio.NewScanner(os.Stdin)
for s.Scan() {
fmt.Printf("read %q\n", s.Text())
}
os.Stdout.Close()
}