3 ms·
I guess I'm left wondering how this is Express inspired vs inspired by the countless other options that already exist in Go. app.Get("/", func(c * fiber.Ctx) {
by mdasen 7y ago
I guess I'm left wondering how this is Express inspired vs inspired by the countless other options that already exist in Go.
app.Get("/", func(c * fiber.Ctx) {
c.Send("Hello, World!")
})
app.GET("/", func(c * gin.Context) {
c.String(200, "Hello World!")
})
app.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
})
app.Get("/", func(ctx iris.Context) {
ctx.Write("Hello World!")
})
app.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World!"))
}) //chi
There are so many micro web frameworks in Go that follow almost exactly the same pattern. It's hard to see how Fiber is substantially different.
Fiber also uses the empty interface a lot in its code. For example, app.Get() just takes `args ...interface{}`. By contrast, Gin's app.GET() takes `relativePath string, handlers ...HandlerFunc`. You know what Gin is expecting you to pass in.