From 6f100618166b8d12ea5f93aa1bf0169163d0ce87 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 25 Jun 2018 08:39:32 +0100 Subject: [PATCH] some CI systems are sending wrong signals ^^ --- input.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/input.go b/input.go index f4a1d3b..3b06d86 100644 --- a/input.go +++ b/input.go @@ -8,12 +8,13 @@ import ( ) func readInput() (input []byte, err error) { - if stdinStat, _ := os.Stdin.Stat(); (stdinStat.Mode() & os.ModeCharDevice) == 0 { - if input, err = ioutil.ReadAll(os.Stdin); err != nil { + + if len(os.Args) > 1 { + if input, err = ioutil.ReadFile(os.Args[1]); err != nil { log.Fatalln(err) } - } else if len(os.Args) > 1 { - if input, err = ioutil.ReadFile(os.Args[1]); err != nil { + } else if stdinStat, _ := os.Stdin.Stat(); (stdinStat.Mode() & os.ModeCharDevice) == 0 { + if input, err = ioutil.ReadAll(os.Stdin); err != nil { log.Fatalln(err) } } else {