Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JodieBenitez
on Oct 16, 2023
|
parent
|
context
|
favorite
| on:
Better HTTP server routing in Go 1.22
Go is not my main tool but I've used Gin which goes like this:
router.GET("/", func(context *gin.Context) { ... }
And it seems to be no different than many other languages/frameworks. Are there more examples that use the "GET /path/" way ?
EspressoGPT
on Oct 16, 2023
|
next
[–]
Most likely not because there's no reason to do it this way other than backwards compatibility ...
tgv
on Oct 16, 2023
|
parent
|
next
[–]
I haven't read the article, but I would guess it's because the http header literally starts like that. You could match that against the first line, instead of having to break it into components.
It does sound like a micro-optimization.
ilyt
on Oct 16, 2023
|
prev
[–]
Haven't seen in the wild. It's just bad way to do it.
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: