current behaviour:
we can only use one router instance in the main func of our application
expected behaviour:
what if we need to split our router into to multiple files (multiple apps inside one project).
thats where we need to make a method called Use() on the Router struct, so that it takes in another router instance.
example
some_module.go
Router = garson.New()
Router.Get('/example', some_handler)
import (
"garson"
"some_module"
)
func main() {
r = garson.Router()
r.Use(some_module.Router)
}
current behaviour:
we can only use one router instance in the main func of our application
expected behaviour:
what if we need to split our router into to multiple files (multiple apps inside one project).
thats where we need to make a method called Use() on the Router struct, so that it takes in another router instance.
example
some_module.go