Skip to content

Commit

Permalink
some CI systems are sending wrong signals ^^
Browse files Browse the repository at this point in the history
  • Loading branch information
wakeful committed Jun 25, 2018
1 parent 702d2d8 commit 6f10061
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6f10061

Please sign in to comment.