Skip to content

Commit

Permalink
Moving action check to top of function
Browse files Browse the repository at this point in the history
  • Loading branch information
blinktag committed Feb 21, 2024
1 parent 9f0239e commit 92d6272
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ func main() {

// readFromStdin reads data piped into stdin
func readFromStdin(opts *opts.CLIOptions) {
if opts.Global.XAction != "write" {
return
}

info, err := os.Stdin.Stat()
if err != nil {
logrus.Fatal(err)
}

if opts.Global.XAction != "write" {
return
}

if info.Mode()&os.ModeCharDevice != 0 {
return
}
Expand Down

0 comments on commit 92d6272

Please sign in to comment.