News for hackers. Stuff that matters.
Re:Go 1.27 by Xeoncross on Wednesday August 19, 2026 @03:34PM (#49366157)
> 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

Re:Go 1.27 by iaaan on Wednesday August 19, 2026 @04:23PM (#49366726)
Neat, stealing this.
Re:Go 1.27 by Xeoncross on Wednesday August 19, 2026 @06:44PM (#49368126)
I wrote a blog on it if you're interested: https://xeoncross.com/2026/better_go_handlers.html
Re:Go 1.27 by greg9381 on Wednesday August 19, 2026 @08:38PM (#49369049)
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.

Re:Go 1.27 by Xeoncross on Wednesday August 19, 2026 @10:01PM (#49369601)
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.
Re:Go 1.27 by knocte on Thursday August 20, 2026 @12:21AM (#49370349)
Can proper Result/Option types be created for Go now?
Re:Go 1.27 by dgunay on Thursday August 20, 2026 @04:18AM (#49371838)
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.