summaryrefslogtreecommitdiffstats
path: root/pkg/commands/os.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-14 23:47:14 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-14 23:47:14 +1000
commitba2b6fbf1fa13ca5a72c18fba996bdd561d4899c (patch)
tree87e27e4455af7e2f885bcbdcd24c64a1cc77c6ab /pkg/commands/os.go
parent4d0702fba53c895d42b48a6abdb0aa26a1bbff8e (diff)
pull errors out of package scope and store sentinel errors on the gui struct
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r--pkg/commands/os.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go
index 9f9819a5a..d4ea75e74 100644
--- a/pkg/commands/os.go
+++ b/pkg/commands/os.go
@@ -14,13 +14,6 @@ import (
gitconfig "github.com/tcnksm/go-gitconfig"
)
-var (
- // ErrNoOpenCommand : When we don't know which command to use to open a file
- ErrNoOpenCommand = errors.New("Unsure what command to use to open this file")
- // ErrNoEditorDefined : When we can't find an editor to edit a file
- ErrNoEditorDefined = errors.New("No editor defined in $VISUAL, $EDITOR, or git config")
-)
-
// Platform stores the os state
type Platform struct {
os string
@@ -113,7 +106,7 @@ func (c *OSCommand) GetOpenCommand() (string, string, error) {
return name, trail, nil
}
}
- return "", "", ErrNoOpenCommand
+ return "", "", errors.New("Unsure what command to use to open this file")
}
// VsCodeOpenFile opens the file in code, with the -r flag to open in the
@@ -157,7 +150,7 @@ func (c *OSCommand) EditFile(filename string) (*exec.Cmd, error) {
}
}
if editor == "" {
- return nil, ErrNoEditorDefined
+ return nil, errors.New("No editor defined in $VISUAL, $EDITOR, or git config")
}
return c.PrepareSubProcess(editor, filename)
}