Fix Staticcheck errors & minor logic simplification (#967)

Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.

Also, minor changes to remove all the statickcheck errors VS code's
Go extension complains about.
This commit is contained in:
Ilya Grigoriev authored and GitHub committed 2022-10-16 18:50:41 +03:00
1 parent e570d5f65b
commit f1312ca969
3 files changed
+17 -21

No files matched your search

+1 -5
View File
@@ -468,7 +468,7 @@ func (win *win) printDir(screen tcell.Screen, dir *dir, selections map[string]in
tag, ok := tags[path]
if ok {
if i == dir.pos {
win.print(screen, lnwidth+1, i, st.Reverse(true), tag)
win.print(screen, lnwidth+1, i, st, tag)
} else {
win.print(screen, lnwidth+1, i, tcell.StyleDefault, fmt.Sprintf(gOpts.tagfmt, tag))
}
@@ -626,10 +626,6 @@ func (ui *ui) echomsg(msg string) {
log.Print(msg)
}
func (ui *ui) echomsgf(format string, a ...interface{}) {
ui.echomsg(fmt.Sprintf(format, a...))
}
func (ui *ui) echoerr(msg string) {
ui.msg = fmt.Sprintf(gOpts.errorfmt, msg)
log.Printf("error: %s", msg)