go.go 341 B

12345678910111213141516171819202122
  1. package tg
  2. func Go(pth Path) UI {
  3. return UI{
  4. GoWidget(pth),
  5. }
  6. }
  7. type GoWidget string
  8. // Implementing the Server interface.
  9. func (widget GoWidget) Serve(c Context) {
  10. c.input.Close()
  11. c.Go(Path(widget))
  12. }
  13. func (widget GoWidget) Render(c Context) UI {
  14. return UI{widget}
  15. }
  16. func (widget GoWidget) Filter(u Update) bool {
  17. return true
  18. }