From c98eddc1857ce6854faabf302186b05f9ce903bf Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 12 Mar 2019 19:20:19 +1100 Subject: appease golangci --- pkg/commands/git.go | 4 ++-- pkg/gui/commits_panel.go | 2 +- pkg/gui/gui.go | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index ec53d985d..f447ec7ad 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -836,7 +836,7 @@ func (c *GitCommand) DiscardOldFileChanges(commits []*Commit, commitIndex int, f // one where we handle the possibility of a credential request, and the other // where we continue the rebase if c.usingGpg() { - errors.New(c.Tr.SLocalize("DisabledForGPG")) + return errors.New(c.Tr.SLocalize("DisabledForGPG")) } commitSha := commits[commitIndex].Sha @@ -872,7 +872,7 @@ func (c *GitCommand) DiscardOldFileChanges(commits []*Commit, commitIndex int, f // amend the commit cmd, err = c.AmendHead() if cmd != nil { - errors.New("received unexpected pointer to cmd") + return errors.New("received unexpected pointer to cmd") } if err != nil { return err diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 9b83d725d..627b35835 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -75,7 +75,7 @@ func (gui *Gui) refreshCommits(g *gocui.Gui) error { gui.handleCommitSelect(g, v) } if g.CurrentView() == gui.getCommitFilesView() { - gui.refreshCommitFilesView() + return gui.refreshCommitFilesView() } return nil }) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index bd1045105..d4ce0b3dc 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -265,7 +265,9 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error { } } else if v.Name() == "commitFiles" { - gui.g.SetViewOnBottom(v.Name()) + if _, err := gui.g.SetViewOnBottom(v.Name()); err != nil { + return err + } } gui.Log.Info(v.Name() + " focus lost") return nil -- cgit v1.2.3