diff options
author | Anthony HAMON <anthony.hamon@iadvize.com> | 2018-08-21 22:33:25 +0200 |
---|---|---|
committer | Anthony HAMON <anthony.hamon@iadvize.com> | 2018-08-26 01:58:19 +0200 |
commit | 364c1ac5e75867bd0f016c01ebc8e52bcbf2ce63 (patch) | |
tree | b8983294fa767191ae5179caa85c11c4ceedf520 /pkg/commands/os.go | |
parent | 883fcf10838879839386091e6375c42b3f0b6a7d (diff) |
remove useless returned variable
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index bc53ccf29..095ad7b0a 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -121,6 +121,7 @@ func (c *OSCommand) OpenFile(filename string) error { // falling back to core.editor, VISUAL, EDITOR, then vi func (c *OSCommand) EditFile(filename string) (*exec.Cmd, error) { editor, _ := gitconfig.Global("core.editor") + if editor == "" { editor = os.Getenv("VISUAL") } @@ -135,13 +136,13 @@ func (c *OSCommand) EditFile(filename string) (*exec.Cmd, error) { if editor == "" { return nil, errors.New("No editor defined in $VISUAL, $EDITOR, or git config") } - return c.PrepareSubProcess(editor, filename) + + return c.PrepareSubProcess(editor, filename), nil } // PrepareSubProcess iniPrepareSubProcessrocess then tells the Gui to switch to it -func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) (*exec.Cmd, error) { - subprocess := exec.Command(cmdName, commandArgs...) - return subprocess, nil +func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) *exec.Cmd { + return exec.Command(cmdName, commandArgs...) } // Quote wraps a message in platform-specific quotation marks |