flip logic to check for input content, this assists debugging in Goland
This commit is contained in:
parent
a29cb7bd9a
commit
4fe9d4a03e
13
html2gmi.go
13
html2gmi.go
@ -56,16 +56,15 @@ func getInput() (string, error) {
|
||||
info, err := os.Stdin.Stat()
|
||||
check(err)
|
||||
|
||||
if info.Mode()&os.ModeNamedPipe != 0 {
|
||||
if *input != "" {
|
||||
//get the input file from the command line
|
||||
dat, err := ioutil.ReadFile(*input)
|
||||
check(err)
|
||||
inputHtml = string(dat)
|
||||
} else if info.Mode()&os.ModeNamedPipe != 0 {
|
||||
// we have a pipe input
|
||||
inputHtml = readStdin()
|
||||
|
||||
} else if *input != "" {
|
||||
//get the input file from the command line
|
||||
dat, err := ioutil.ReadFile(*input)
|
||||
check(err)
|
||||
inputHtml = string(dat)
|
||||
|
||||
} else {
|
||||
//we shouldn't get here
|
||||
return "", errors.New("invalid option for input - use -i <path> or pipe to stdin")
|
||||
|
Loading…
Reference in New Issue
Block a user