delve/_fixtures/redirect.go
aarzilli 7555d1c063 cmd,proc,terminal,debugger: Support default file descriptor redirects
Adds features to support default file descriptor redirects for the
target process:

1. A new command line flag '--redirect' and '-r' are added to specify
   file redirects for the target process
2. New syntax is added to the 'restart' command to specify file
   redirects.
3. Interactive instances will check if stdin/stdout and stderr are
   terminals and print a helpful error message if they aren't.
2020-09-01 21:50:27 +02:00

14 lines
164 B
Go

package main
import (
"fmt"
"io/ioutil"
"os"
"time"
)
func main() {
buf, _ := ioutil.ReadAll(os.Stdin)
fmt.Fprintf(os.Stdout, "%s %v\n", buf, time.Now())
}