summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorKristijan Husak <husakkristijan@gmail.com>2018-10-15 11:00:19 +0200
committerKristijan Husak <husakkristijan@gmail.com>2018-10-15 11:00:19 +0200
commitc69fce2e9d28dc847ad5a4528b99682fe61762af (patch)
tree78656e59f065b6149883094f90a41c1a7cd58e3b /pkg
parentdf0e3e52fea02950d78af5233a859f592092d475 (diff)
Remove unnecessary nil error in NewPullRequest.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/pull_request.go4
-rw-r--r--pkg/commands/pull_request_test.go5
-rw-r--r--pkg/gui/branches_panel.go2
3 files changed, 6 insertions, 5 deletions
diff --git a/pkg/commands/pull_request.go b/pkg/commands/pull_request.go
index 4eb030042..bd076d877 100644
--- a/pkg/commands/pull_request.go
+++ b/pkg/commands/pull_request.go
@@ -44,11 +44,11 @@ func getServices() []*Service {
}
// NewPullRequest creates new instance of PullRequest
-func NewPullRequest(gitCommand *GitCommand) (*PullRequest, error) {
+func NewPullRequest(gitCommand *GitCommand) *PullRequest {
return &PullRequest{
GitServices: getServices(),
GitCommand: gitCommand,
- }, nil
+ }
}
// Create opens link to new pull request in browser
diff --git a/pkg/commands/pull_request_test.go b/pkg/commands/pull_request_test.go
index 8173edc71..111845e6d 100644
--- a/pkg/commands/pull_request_test.go
+++ b/pkg/commands/pull_request_test.go
@@ -1,10 +1,11 @@
package commands
import (
- "github.com/stretchr/testify/assert"
"os/exec"
"strings"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestGetRepoInfoFromURL(t *testing.T) {
@@ -144,7 +145,7 @@ func TestCreatePullRequest(t *testing.T) {
gitCommand := newDummyGitCommand()
gitCommand.OSCommand.command = s.command
gitCommand.OSCommand.Config.GetUserConfig().Set("os.openCommand", "open {{filename}}")
- dummyPullRequest, _ := NewPullRequest(gitCommand)
+ dummyPullRequest := NewPullRequest(gitCommand)
s.test(dummyPullRequest.Create(s.branch))
})
}
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index b4ba151b5..11a4a0ebb 100644
--- a/pkg/gui/branches_panel.go
+++ b/pkg/gui/branches_panel.go
@@ -24,7 +24,7 @@ func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error {
func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error {
branch := gui.getSelectedBranch(gui.getBranchesView(g))
- pullRequest, _ := commands.NewPullRequest(gui.GitCommand)
+ pullRequest := commands.NewPullRequest(gui.GitCommand)
if err := pullRequest.Create(branch); err != nil {
return gui.createErrorPanel(g, err.Error())