diff --git a/README.md b/README.md index 9d22687..b344bb0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ func layout(g *gocui.Gui) error { return nil } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func main() { var err error @@ -47,7 +47,7 @@ func main() { log.Panicln(err) } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/_examples/delete.go b/_examples/delete.go index fa05119..42e3d80 100644 --- a/_examples/delete.go +++ b/_examples/delete.go @@ -38,7 +38,7 @@ func main() { } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } @@ -109,7 +109,7 @@ func initKeybindings(g *gocui.Gui) error { } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func newView(g *gocui.Gui) error { diff --git a/_examples/demo.go b/_examples/demo.go index 1d0dc5d..eebcd09 100644 --- a/_examples/demo.go +++ b/_examples/demo.go @@ -105,7 +105,7 @@ func delMsg(g *gocui.Gui, v *gocui.View) error { } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func keybindings(g *gocui.Gui) error { @@ -217,7 +217,7 @@ func main() { g.ShowCursor = true err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/_examples/layout.go b/_examples/layout.go index 24a865d..5a6ed6f 100644 --- a/_examples/layout.go +++ b/_examples/layout.go @@ -28,7 +28,7 @@ func layout(g *gocui.Gui) error { } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func main() { @@ -47,7 +47,7 @@ func main() { } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/_examples/overlap.go b/_examples/overlap.go index 0f6c3e9..78e9868 100644 --- a/_examples/overlap.go +++ b/_examples/overlap.go @@ -52,7 +52,7 @@ func layout(g *gocui.Gui) error { } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func main() { @@ -70,7 +70,7 @@ func main() { } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/_examples/wrap.go b/_examples/wrap.go index 098e171..aac8014 100644 --- a/_examples/wrap.go +++ b/_examples/wrap.go @@ -29,7 +29,7 @@ func layout(g *gocui.Gui) error { } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func main() { @@ -47,7 +47,7 @@ func main() { } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/doc.go b/doc.go index 54a11e9..e0e4ac9 100644 --- a/doc.go +++ b/doc.go @@ -14,7 +14,7 @@ Example: return nil } func quit(g *gocui.Gui, v *gocui.View) error { - return gocui.ErrorQuit + return gocui.Quit } func main() { var err error @@ -28,7 +28,7 @@ Example: log.Panicln(err) } err = g.MainLoop() - if err != nil && err != gocui.ErrorQuit { + if err != nil && err != gocui.Quit { log.Panicln(err) } } diff --git a/gui.go b/gui.go index bd98b11..c369deb 100644 --- a/gui.go +++ b/gui.go @@ -11,8 +11,8 @@ import ( ) var ( - // ErrorQuit is used to decide if the MainLoop finished succesfully. - ErrorQuit error = errors.New("quit") + // Quit is used to decide if the MainLoop finished succesfully. + Quit error = errors.New("quit") // ErrorUnkView allows to assert if a View must be initialized. ErrorUnkView error = errors.New("unknown view") @@ -197,7 +197,7 @@ func (g *Gui) SetLayout(layout func(*Gui) error) { } // MainLoop runs the main loop until an error is returned. A successful -// finish should return ErrorQuit. +// finish should return Quit. func (g *Gui) MainLoop() error { go func() { for {