support pipes

This commit is contained in:
Niklas 2019-11-04 21:26:21 +01:00
parent 8223e02e50
commit 7a6c0df33a

View File

@ -163,9 +163,12 @@ func main() {
if err != nil {
log.Fatal(err)
}
if fi.Mode()&os.ModeNamedPipe == 0 {
if fi.Size() == 0 {
log.Fatal("stdin is empty")
}
}
data, err := ioutil.ReadAll(os.Stdin)
rawEml := string(data)