Comments (3)
Okay, so I think it's a bit more nuanced then. I saw an error when you only have one controller action and that controller action had no results. I think it's an "import is not used" error. If so, should be pretty easy to fix, just moving an
imports.AddNamed
to a different location in the controller loader.
So I did a bit of playing around with different void scenarios, and the only scenario I found that didn't work was having a void action tied to a view. It resulted in:
# github.com/go-duo/bud/example/basic/bud/.app/controller
bud/.app/controller/controller.go:50:24: not enough arguments in call to i.View.Handler
have (string)
want (string, interface{})
Yep, I totally think it makes sense for
func (c *Controller) Action(...) error { return nil }
to also return a204 No Content
Both of these are fixed in #68
from bud.
This seems to work for void controllers already. Changing the Show
in the basic example results in a 204.
However, if the func returns a nil error, it is parsed as a 200. Not sure if it would make sense for void and nil error to parse the same.
from bud.
Thanks for looking into this!
This seems to work for void controllers already.
Okay, so I think it's a bit more nuanced then. I saw an error when you only have one controller action and that controller action had no results. I think it's an "import is not used" error. If so, should be pretty easy to fix, just moving an imports.AddNamed
to a different location in the controller loader.
if the func returns a nil error, it is parsed as a 200
Yep, I totally think it makes sense for func (c *Controller) Action(...) error { return nil }
to also return a 204 No Content
So I think there's 1 fix and 1 improvement. Updating the title.
from bud.
Related Issues (20)
- using 'change.me' placeholder in go.mod causes network connections to hostname 'change.me' HOT 3
- generated app directory fails linting with golangci-lint HOT 1
- feature idea: detect git short version hash during build and embed into binary HOT 2
- feature suggestion: `bud run` should launch browser (maybe with a flag to enable?) HOT 1
- Error during cURL Installation (Mac) HOT 5
- How to integrate svelte libraries into bud HOT 1
- Rendering HTML from Svelte SSR HOT 1
- invalid: unknown revision since 0.2.6 HOT 2
- Improve bud create logging HOT 2
- How to change default id:int to name:string in generated url path? HOT 1
- How to cross compile linux app binary in my macos machine? HOT 3
- bud run fails right after adding controller following video HOT 18
- Memory Profiling a Bud service HOT 5
- Support for FreeBSD HOT 1
- Ship statically linked binaries? HOT 1
- undefined: sqlite3.Error issue HOT 5
- Middleware support? HOT 1
- Dev server breaks as soon as I generate a new controller HOT 2
- Issue with afs on bud run HOT 1
- Add support for skeleton UI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bud.