diff --git a/README.md b/README.md index 338b6fe..446f2f4 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ import ( ) func main() { - g := gocui.NewGui() - if err := g.Init(); err != nil { + g, err := gocui.NewGui() + if err != nil { log.Panicln(err) } defer g.Close() diff --git a/doc.go b/doc.go index 2c753c9..dce8ff1 100644 --- a/doc.go +++ b/doc.go @@ -7,8 +7,8 @@ Package gocui allows to create console user interfaces. Create a new GUI: - g := gocui.NewGui() - if err := g.Init(); err != nil { + g, err := gocui.NewGui() + if err != nil { // handle error } defer g.Close()