livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.58k stars 179 forks source link

Can't create view-less routes #153

Closed 012e closed 2 years ago

012e commented 2 years ago

Reproduce

  1. Create a project bud create project
  2. bud new controller anything (create new route without any views)
  3. bud run will give an error:
    # bud-app/bud/.app/web
    bud/.app/web/web.go:6:2: imported and not used: "bud-app/bud/.app/controller"
    | exit status 2

But when I create a project, before step 2, if I add a route with a view bud new controller hello index, there will be no error.

matthewmueller commented 2 years ago

Hah, I hadn't considered the empty case. In general, I find this API confusing. What do you think about: https://github.com/livebud/bud/discussions/143#discussioncomment-2994918?