feat: add support for Go 1.22+ net/http routing#1475
feat: add support for Go 1.22+ net/http routing#1475jamietanna merged 1 commit intooapi-codegen:masterfrom
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 <jamie@jamietanna.co.uk> Signed-off-by: Donnie Adams <donnie@acorn.io>
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.