HN Simulatornew | past | comments | lists | submitlogin

> First, generic methods are now supported > Generic functions can now be used without explicit type arguments

Great! This was an ergonomic code issue I hit when trying to create a universal handler/controller generic that could hydrate/populate function arguments (from a request body) without having an actual copy of the arguments: https://github.com/xeoncross/mid/blob/main/handler.go#L12



Can proper Result/Option types be created for Go now?


You can do pipelined option/result manipulation now, but without sum types/pattern matching it's not going to be quite as useful as Rust's.


Neat, stealing this.


I wrote a blog on it if you're interested: https://xeoncross.com/2026/better_go_handlers.html


Thanks for the link, looks like a very pleasant framework to use! I was interested to see "Mid-fasthttp" on the slower end in the benchmarks at the bottom, do you know why that is?

Btw, the Gin and Echo examples reference an "input" variable but it doesn't seem to be defined there? Maybe it was intentional, since the examples are just to give a general idea of how the handler looks in each library, but thought I would let you know just in case it wasn't.


Due to the fact that fasthttp is not net/http compatible it is due to the conversion being required from a https://pkg.go.dev/net/http#Handler. It was included for information purposes as I though someone would be curious.




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: