lint the code with vim-go

This commit is contained in:
tramhao 2021-02-03 11:34:50 +08:00
parent 66a73bae4b
commit f12f0b694e
3 changed files with 19 additions and 21 deletions

38
gomu.go
View File

@ -91,21 +91,21 @@ func (g *Gomu) cyclePanels() Panel {
}
func (g *Gomu) cyclePanels2() Panel {
first :=g.panels[0]
second :=g.panels[1]
if first.HasFocus() {
g.setFocusPanel(second)
g.prevPanel = second
return second
} else if second.HasFocus() {
g.setFocusPanel(first)
g.prevPanel = first
return first
} else {
g.setFocusPanel(first)
g.prevPanel = first
return first
}
first := g.panels[0]
second := g.panels[1]
if first.HasFocus() {
g.setFocusPanel(second)
g.prevPanel = second
return second
} else if second.HasFocus() {
g.setFocusPanel(first)
g.prevPanel = first
return first
} else {
g.setFocusPanel(first)
g.prevPanel = first
return first
}
}
// Changes title and border color when focusing panel
@ -119,10 +119,10 @@ func (g *Gomu) setFocusPanel(panel Panel) {
if g.prevPanel == nil {
return
}
if g.prevPanel != panel {
g.setUnfocusPanel(g.prevPanel)
}
if g.prevPanel != panel {
g.setUnfocusPanel(g.prevPanel)
}
}
// Safely write the IsSuspend state, IsSuspend is used to indicate if we

View File

@ -30,7 +30,6 @@ func setupLog() {
log.Fatalf("Error opening file %s", logFile)
}
log.SetOutput(file)
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
}

View File

@ -21,7 +21,6 @@ func logError(err error) {
log.Println(tracerr.Sprint(err))
}
// Formats duration to my desired output mm:ss
func fmtDuration(input time.Duration) string {