flip logic to check for input content, this assists debugging in Goland

This commit is contained in:
Luke Emmet 2020-08-25 23:40:53 +01:00
parent a29cb7bd9a
commit 4fe9d4a03e

View File

@ -56,15 +56,14 @@ func getInput() (string, error) {
info, err := os.Stdin.Stat() info, err := os.Stdin.Stat()
check(err) check(err)
if info.Mode()&os.ModeNamedPipe != 0 { if *input != "" {
// we have a pipe input
inputHtml = readStdin()
} else if *input != "" {
//get the input file from the command line //get the input file from the command line
dat, err := ioutil.ReadFile(*input) dat, err := ioutil.ReadFile(*input)
check(err) check(err)
inputHtml = string(dat) inputHtml = string(dat)
} else if info.Mode()&os.ModeNamedPipe != 0 {
// we have a pipe input
inputHtml = readStdin()
} else { } else {
//we shouldn't get here //we shouldn't get here