diff --git a/tg/context.go b/tg/context.go index 9003ae0..ed82f3a 100644 --- a/tg/context.go +++ b/tg/context.go @@ -169,7 +169,7 @@ func (af ActionFunc) Act(c *Context) { } // Changes screen of user to the Id one. -func (c *Context) Go(pth Path, args ...any) error { +func (c *Context) Go(pth Path, args ...any) { if pth == "-" { pth = c.PrevPath() } @@ -180,7 +180,7 @@ func (c *Context) Go(pth Path, args ...any) error { } if !c.PathExist(pth) { - return ScreenNotExistErr + panic(ScreenNotExistErr) } c.prevPath = c.path c.path = pth @@ -193,8 +193,6 @@ func (c *Context) Go(pth Path, args ...any) error { } else { panic("no widget defined for the screen") } - - return nil } func (c *Context) PathExist(pth Path) bool { diff --git a/tg/screen.go b/tg/screen.go index 3db33d8..bafb3ba 100644 --- a/tg/screen.go +++ b/tg/screen.go @@ -11,10 +11,7 @@ type ScreenGo struct { } func (sc ScreenGo) Act(c *Context) { - err := c.Go(sc.Path, sc.Args...) - if err != nil { - panic(err) - } + c.Go(sc.Path, sc.Args...) } // The same as Act.