Skip to content

Commit

Permalink
fix: lint if-else error
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 31, 2024
1 parent 6fa8a85 commit 4c9ba53
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ func backgroundColor(in *os.File, out *os.File) (color.Color, error) {
func BackgroundColor(in *os.File, out *os.File) (bg color.Color, err error) {
if runtime.GOOS == "windows" {
return backgroundColor(in, out)
} else {
// NOTE: On Unix, one of the given files must be a tty.
for _, f := range []*os.File{in, out} {
if bg, err = backgroundColor(f, f); err == nil {
return bg, nil
}
}

// NOTE: On Unix, one of the given files must be a tty.
for _, f := range []*os.File{in, out} {
if bg, err = backgroundColor(f, f); err == nil {
return bg, nil
}
}

return
}

Expand Down

0 comments on commit 4c9ba53

Please sign in to comment.