I started learning Gin recently and in the README file comes the following code:
v1 := router.Group("/v1")
{
v1.POST("/login", loginEndpoint)
v1.POST("/submit", submitEndpoint)
v1.POST("/read", readEndpoint)
}
I readed the source code for the method Group and is like this:
IRouter interface {
IRoutes
Group(string, ...HandlerFunc) *RouterGroup
}
Maybe I'm misunderstanding the syntaxis or missing something in the code (Im pretty new in Go) but it looks like it is passing a block as the second argument, is this possible in Go?