New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ContentTypeForm functionality to DecodeForm #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show us the use case for this PR so we fully understand it?
We're trying to keep go-chi packages without any unnecessary 3rd party vendor dependencies. I'm not yet sure if we want to pull in gorilla/schema
.
Literally I just want the ability for decoding the following:
I would say we could spend the time to recreate the functionality of gorilla/schema if you're trying to keep this repository free of dependencies, but it's pretty much the defacto standard for dealing with form data, and has fixed a lot of edge cases around them. |
We have couple of options. |
If I'm not mistaken, go-querystring is specifically for the case of utilizing urlencoded query arguments, rather than extracting form data into url.Values. When comparing ajg/form and gorilla/schema, it seems like both implementations could be viable, it's honestly a flip of the coin on that one. |
@VojtechVitek How would you like me to proceed with this? I believe that gorilla/schema is a good choice for this, but if you would like to vet the others, that's reasonable. |
@syntaqx you're right, go-querystring only implements encoding. We should evaluate decide between the two other packages. Both seem very mature to me. However, https://github.com/ajg/form looks simpler and more elegant to me. https://github.com/gorilla/schema looks quite complex for what it's supposed to do, especially the internal cache: https://github.com/gorilla/schema/blob/master/cache.go#L18-L33 |
Sorry for the massive delay on this. I've switched to using |
@VojtechVitek Let me know if you need anything from me. Would love to switch over to using this package instead of a fork again! |
@syntaqx thanks, I'll take a look when I have some spare time. I'm too busy right now with my job |
@@ -7,6 +7,8 @@ import ( | |||
"io" | |||
"io/ioutil" | |||
"net/http" | |||
|
|||
"github.com/ajg/form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we bring in github.com/ajg/form as golang/dep dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a more global question for you, for the project. Currently there's no dependency tooling, so I didn't add any.
Any reason as to why this isn't merged yet, we need this at work too. |
@otraore I want to get this merged together with golang/dep files. |
I've added dep. |
Any follow up on this? |
Sorry I'm too busy at this point. I'll try to come back to this when I have some spare time. |
Hey @VojtechVitek - I know you've been busy, but was just wondering if you've had the chance to look at this? If not, perhaps you'd be willing to add myself or someone else as a maintainer? Would love to be able to keep using this, but without support it's becoming very unreasonable. |
As an aside, |
Is there some progress on this? I'd love to see this land. |
¯\(ツ)/¯ can't seem to get him to merge it. |
Open-source is tough, man. Merging this PR means I'd have to spend hours of testing this changeset in the pre-production & production environments with all of our projects. I'm willing to do that - but not right away, since I have different priorities at this time. Send bitcoin or ETH and I'll find some time sooner! :D |
@VojtechVitek While I can appreciate having to find time to deal with a PR on an open-source project, it's literally been a year since I opened this. I'd be happy to manage this project if you're unable to? |
You're right. I'm slow. And I'm sorry. I'll try to test this when I find some time soonish. |
Happy 2019 @VojtechVitek - How're we doing on getting this merged friend? Especially given we have Semantic Versioning now, I feel like the issue is less complicated. |
Hey @VojtechVitek, |
Is this project no longer maintained? This is a pretty simple PR and has been open for 4 years. |
I'm sorry. I don't currently use go-chi/render. This PR has some old module mgmt system, so I prefer not to merge it right away. |
I'm more than happy to include Go modules, assuming that you will actually make an effort to get this merged. What are you using instead of this project, so that people can look to that? Additionally, I'm more than happy to help maintain this project if you're open to it. It certainly needs a few modernization updates, but there's plenty of participation on the project that could use responses, and some additional features would make it a more than viable option for folks.and would be more than happy to even maintain the repository to provide it with some additional functionality that it would benefit from, b |
Removes dep, introduces Go modules, and updates a missing http const
@VojtechVitek I've updated the pull request:
If we could move to getting this merged in, that would be awesome. Also, please let me know your thoughts on the future of this project, as I would be more than happy to provide it a bit of attention and some much needed updates, but I don't want another 4 years of PR delays ;) |
Sorry, couple minor updates there; didn't realize the linting wasn't passing. Actually good for review/merge now. |
I would be willing to assist @syntaqx in maintaining Render. Chi and Render are certainly being used in production in various projects and really need to be kept current. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for switching to Go Modules and to Github Actions too. Great job!
For reference:
https://github.com/syntaqx/go-chi-render/runs/2451985236
https://github.com/syntaqx/go-chi-render/runs/2451985149
@@ -66,7 +66,7 @@ func PlainText(w http.ResponseWriter, r *http.Request, v string) { | |||
if status, ok := r.Context().Value(StatusCtxKey).(int); ok { | |||
w.WriteHeader(status) | |||
} | |||
w.Write([]byte(v)) | |||
w.Write([]byte(v)) //nolint:errcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: _ = w.Write()
would be imho more idiomatic than using some special comments
Some of my companies legacy applications require the ability to use
ContentTypeForm
. I didn't realize go-chi/render didn't support this until we started running into random breakage..