aboutsummaryrefslogtreecommitdiffstats
path: root/termui
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-07-20 15:45:31 +0200
committerMichael Muré <batolettre@gmail.com>2020-07-20 15:45:31 +0200
commitac7e50863340ecddc2df219886019f0816e465f0 (patch)
tree7ed0946296dcfd63b42dcb9fd7dba2a9370ff849 /termui
parentc0bf7c359f0e361825afed8c3c809cbfc5707386 (diff)
downloadgit-bug-ac7e50863340ecddc2df219886019f0816e465f0.tar.gz
termui: avoid importing a whole package to check an error
Diffstat (limited to 'termui')
-rw-r--r--termui/termui.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/termui/termui.go b/termui/termui.go
index 96b7583c..ec5387a4 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -7,8 +7,6 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/pkg/errors"
- errors2 "github.com/go-errors/errors"
-
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/input"
@@ -67,8 +65,12 @@ func Run(cache *cache.RepoCache) error {
err := <-ui.gError
+ type errorStack interface {
+ ErrorStack() string
+ }
+
if err != nil && err != gocui.ErrQuit {
- if e, ok := err.(*errors2.Error); ok {
+ if e, ok := err.(errorStack); ok {
fmt.Println(e.ErrorStack())
}
return err