-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add support for Go 1.22+ net/http routing #1475
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
Conversation
9d4fa9c to
36b6852
Compare
|
Thanks for raising this! I'd prefer we keep the examples / tests as Go 1.20 (as that's the intended requirement for all uses) and use Go build tags to only build the |
|
@jamietanna Thanks for your feedback! I made the adjustment as you suggested. In order to accomplish this, I also had to do the following:
|
|
Thanks for the tweaks! I'm just reviewing now, and will push the changes to address this 👍 |
2897b9c to
6efe217
Compare
|
(Still WIP - got a few tweaks to get things hooked in right, and fix a couple of cases) |
4a9859d to
1781f71
Compare
|
Once #1482 is in I'll rebase, amend the commit message, then @thedadams did you want to have a look and decide if you'd like to add a |
1781f71 to
bb06403
Compare
|
Addressed both of the above, re-added my sign-off, and added the co-author tag (thanks for the help here @jamietanna!). |
As part of oapi-codegen#1068, we want to add support for the new Go 1.22+ `net/http`-only router, which will allow using `oapi-codegen` with reduced external dependencies. This requires we: - wire in a new server, `std-http` - add relevant templates for the router and strict server - conditionally build/test/lint/etc the code when running on older versions of Go, which requires a bit of work in our `Makefile` - use a separate module for the generated code, as it must set `go 1.22` in the `go.mod` - document the fact that the `go.mod` needs updating, too, as it's caused some time to be lost in the past Closes oapi-codegen#1068. Co-authored-by: Jamie Tanna <[email protected]> Signed-off-by: Donnie Adams <[email protected]>
9f71327 to
3b9748e
Compare
|
Thanks @thedadams 🙌 did a last tweak, don't know if you wanted to amend the commit so it's verified as your changes (with my co-authored) or if you're happy me merging as-is? |
|
@jamietanna Looks good! Thank you. |
A couple notes on these changes:
go.modfiles to be bumped. I also bumped the version in the maingo.modfile, although I don't think that is required.