summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-03-12 19:20:19 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-03-16 10:20:27 +1100
commitc98eddc1857ce6854faabf302186b05f9ce903bf (patch)
tree68a5c395165623d9b154e77963e3bc7a7e117dc7 /pkg
parent3b2353b5aecf0b711e419cabc2a0e0a6682110cf (diff)
appease golangci
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git.go4
-rw-r--r--pkg/gui/commits_panel.go2
-rw-r--r--pkg/gui/gui.go4
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