News for hackers. Stuff that matters.
Re:Some Go web dev notes by srameshc on Sunday September 29, 2024 @12:21PM (#41688418)
Good to see author's mention about routing. I am mentally stuck with mux for a long time and didn't pay attention to the new release features. Happy that I always find things like these on HN.
Re:Some Go web dev notes by JodieBenitez on Sunday September 29, 2024 @12:58PM (#41688638)
Nice new feature, would actually make me want to use Go without Gin.
Re:Some Go web dev notes by leetrout on Sunday September 29, 2024 @01:08PM (#41688720)
I am over Gin and have been for years yet everyone keeps using it because it has inertia. The docs are garbage.

Big fan of Echo and it has much better docs.

https://echo.labstack.com/

Re:Some Go web dev notes by JodieBenitez on Sunday September 29, 2024 @02:52PM (#41689495)
Thanks for the suggestion, will give it a try. I'm more familiar with Python than Go. I know my way around the Python ecosystem and can make informed decisions about which tool to use. Not so much with Go, so I appreciate your advice.
Re:Some Go web dev notes by xerox13ster on Sunday September 29, 2024 @02:29PM (#41689340)
I had to move from Gin to echo for my personal site, the routing in Gin was refusing to serve static resources at the root path without some headache.
Re:Some Go web dev notes by rwdf on Monday September 30, 2024 @01:57AM (#41693985)
I've grown to prefer go-chi over Gin (or Echo), since it's just the standard library with some QoL features on top.
Re:Some Go web dev notes by thiht on Monday September 30, 2024 @04:12AM (#41694724)
Chi is amazing. I love the philosophy of extending the stdlib instead of writing an alternative. I try to keep that in mind when writing my own libs or helpers now, and I'm very satisfied with the results.

For example I made a lib to write commands (like cobra or urfave/cli), but based entirely on the `flag` package: https://github.com/Thiht/go-command

Re:Some Go web dev notes by JodieBenitez on Monday September 30, 2024 @07:46AM (#41696065)
Nice CLI lib ! I'm still looking for a Argh or Typer equivalent though.
Re:Some Go web dev notes by rwdf on Monday September 30, 2024 @03:19PM (#41700947)
> For example I made a lib to write commands (like cobra or urfave/cli), but based entirely on the `flag` package: https://github.com/Thiht/go-command

Looks nice! I'd like an easier way of setting both long and short flags for a command, i.e. --verbose and -v should do the same. Using `flag` I have to declare everything twice to achieve this.

Re:Some Go web dev notes by linhns on Monday September 30, 2024 @07:30AM (#41695955)
I like it, but with the new http.ServeMux rolled out in Go 1.22, is there any use for Chi anymore?
Re:Some Go web dev notes by rwdf on Monday September 30, 2024 @03:09PM (#41700822)
Good question. The middleware stack it provides is nice.