Summary of 2023 trend Go language frameworks recommended by corporate engineers

Provides useful information for choosing a framework for the Go language in 2023.

overview

More and more developers are using the Go language today, and many are looking to frameworks to help them develop more applications.

There are Go language frameworks available for a variety of uses, but choosing the best framework for your own product can be a daunting task.

So here are six frameworks that I’ve used and found to be excellent and that I use frequently. This article also provides information to help you choose your framework for the Go language in 2023.

name | Github | Star | | ————————————————- ——————— | —————————- —————————————- | —– | | Gin | https://github.com/gin-gonic/gin | 54.8K | | Revel | https://github.com/revel/revel | 12.6K | | Beego | https://github.com/beego/beego | 27.6K | | Iris | https://github.com/kataras/iris | 21.7K | | Echo | https://github.com/labstack/echo | 21.5K | | Fafiber | [https://github.com/gofiber/fiber](https:/ /github.com/gofiber/fiber) | 17.7K |

Go language framework list table

Gin

If you have ever touched the Go language, it is a very popular framework that you have almost certainly heard about. Its popularity is due to its excellent performance and developability.

The reason it performs so well is because it uses a feature called HttpRouter which makes routing fast. Thanks to this, you can create APIs with up to 40x faster performance.

In terms of productivity, think of developing straight out of the box in plain Go language. When creating a simple GET method API, I think that beginners will be disappointed with the amount of description. I am also one of them. But with Gin you have very clear routing control. Please refer to the sample code below to see how clear it will be.

Plain Go

func Index(w http.ResponseWriter, r *http.Request, _httprouter.Params) {
  fmt.Fprint(w, "Welcome!\n")
}

http. HandleFunc("/users/", Index)

Gin

func(c *gin. Context) {
  c.JSON(200, gin.H{ "message": "Welcome"})
})

router. GET("/", Index)

merit

  1. Support for creating middleware Gin supports writing middleware. Middleware can describe the processing that must be executed between each function. As a result, development efficiency and code shortening can be expected.

  2. De facto standard It is the most popular and famous framework at present. It has a great amount of documentation and blogs, making it a great framework for beginners to learn.

  3. High performance Gin is very memory efficient and can be used with high performance.

Demerit

  1. Steep learning curve Gin is a relatively simple Go language framework, but it can be expensive to learn for beginners. Especially if you are unfamiliar with the Go language itself, understanding the grammar and structure can be time consuming.

  2. Lack of feature richness Gin is known as a lightweight and simple framework that does not offer as many features as other frameworks. Some advanced features and modules may be missing. So if you need specific functionality, you may need to use a different library or module.

  3. Lack of documentation Gin is a popular framework, but the amount and depth of official documentation can be small compared to other frameworks. As such, you may need to rely on other developer’s blogs and source code references if you run into problems or want to understand a particular feature.

  4. DIFFERENCES IN COMMUNITY SUPPORT Although Gin is a popular framework, it can have a slightly smaller and less active community than other frameworks. Therefore, if you encounter any issues or bugs, it may take some time to resolve them.

Environment

// Install the executable.
$ go get -u github.com/gin-gonic/gin

Sample code

package main

import "github.com/gin-gonic/gin"

func main() {
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
  c.JSON(200, gin.H{
    "message": "pong",
  })
})
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

Author Rating

It’s the de facto standard of the Go language, but if you try it, you’ll immediately understand why it’s become so popular. The ease of introduction, the ease of learning, and the flexibility of being able to do everything from small-scale development to medium-scale development are all excellent. Because it is simple and easy to read, it demonstrates its power in beginner’s individual development and team development.

It is the framework No1 that I would like to recommend to beginners.

Revel

Revel’s MVC architecture makes it an easy framework to learn if you’ve used CakePHP for PHP or Spring for Java.

Revel offers the following features: All of them are easy to use and are a must-have feature in modern frameworks.

  • routing
  • Parameter analysis
  • test
  • session control
  • template
  • caching
  • Job execution

Sample code

type MyAppController struct {
  revel. Controller
  MyMappedData map[string]interface{}
}

// Assume that this is called for all the controller functions
func (c MyAppController) Before() {
  c.MyMappedData = map[string]interface{}{}
}

// This function will be called when the Controller is put back into the stack
func (c MyAppController) Destroy() {
  c.Controller.Destroy()
  // Clean up locally defined maps or items
  c. MyMappedData = nil
}

merit

  1. MVC architecture support Revel supports creating MVC. MVC can separate Model, Vuew, and Controller, it is possible to divide responsibility in team development, and it becomes easy to reuse functions.

  2. High performance Revel is very memory efficient and you can expect high performance with it.

Demerit

  1. Framework size Revel is a relatively large framework and can have large file sizes compared to other lightweight frameworks. This can affect project size and deployment time.

  2. Limited flexibility Revel adheres strictly to an MVC architecture and may have limitations when customizing it for specific development styles and patterns. As such, it may be less flexible than other frameworks.

  3. Learning costs Revel can be expensive to learn compared to some other frameworks. Especially if you are unfamiliar with the MVC architecture and Revel-specific concepts, it may take some time to learn.

  4. Documentation and Resource Limitations Revel may have limited documentation and resources compared to other popular frameworks. As such, you may struggle to find solutions or development tips for your particular problem. Also, the community size is small compared to other frameworks, and support and feedback response may be slow.

  5. Low developer popularity Revel may be less popular with developers than some other frameworks. This may affect various aspects faced by developers, such as the developer job market and the provision of support.

Environment

git clone https://github.com/revel/examples.git
revel run examples/booking

Author Rating

Revel is an easy-to-use framework with an MVC architecture that provides high performance. However, some disadvantages must also be considered.

The advantage is support for MVC architecture, which facilitates team development and reuse of functionality. You can also expect high performance.

Disadvantages include the relatively large size of the framework and limited flexibility. Learning costs can also be higher than some other frameworks, and you should also be aware of limited documentation and resources, and low developer popularity.

Overall, Revel is well suited for developers familiar with MVC architectures and projects that require high performance. However, it is necessary to consider the disadvantages such as the size of the framework and the learning cost, and carefully judge whether it meets the requirements of the project and the needs of the developer.

beego

Beego is a Go language framework that offers many features and is ideal for large-scale application development.

It is multi-functional, and you can build Restful API, web application, backend service development, etc. with this one.

Beego consists of four basic functions.

  • Basic module Contains log module, configuration module and governor module.
  • tasks Used to run timed or recurring tasks. You can easily build a cron job.
  • client Includes ORM module, httplib module and cache module.
  • server Contains web modules. We will support gRPC in the future.

merit

I’m sorry, but as an addendum to the previous answer, the additional benefits of using beego are summarized below.

merit

  1. High scalability beego offers a wide range of extension functions, and you can easily add application functions by using modules and plug-ins. It can be extended to meet the needs of different domains and industries.

  2. Abundance of modules beego provides many modules, and you can easily use functions such as log management, configuration management, task scheduling, ORM, HTTP client, caching, etc. This increases the efficiency of application development.

  3. Sufficiency of documentation beego has extensive official documentation, including API references and tutorials. The materials are easy to understand even for beginners, and are useful in supporting learning and development.

  4. Active community beego has an active open source community. Developers exchange information, provide support, fix bugs and develop new features, and the power of the community drives the growth and improvement of the framework.

Demerit

  1. Documentation and Resource Limitations beego can have limited documentation and resources compared to some other popular frameworks. You may have trouble finding specific issues or development tips. Also, the community may be small and the response to support and feedback may be slow.

  2. Learning costs beego can be expensive to learn for first-time developers. It may take some getting used to the MVC architecture and beego specific concepts.

  3. Limited flexibility beego has limited flexibility compared to some other frameworks. There may be constraints when customizing for a particular development style or pattern. As such, it may be less flexible than other frameworks.

  4. Active community Beego’s community may not be as active as some other frameworks. It may affect various aspects that developers face, such as developer popularity and the availability of support.

Environment

go get github.com/beego/beego/v2@latest

Sample code

package main

import "github.com/beego/beego/v2/server/web"

func main() {
  web. Run()
}

Author Rating

beego is a Go language framework that is versatile and suitable for large-scale application development. It provides features that improve development efficiency and flexibility, such as rich modules and extensions, and support for MVC architecture.

I also like the richness of the documentation and the active community. There are plenty of official documents and tutorials, making it easy for beginners to learn. In addition, the community exchanges information and provides support, improving and developing new features to meet developer needs.

However, there are some challenges with limited documentation and resources, high learning costs, limited flexibility, and community activity. Due to limited documentation and resources, it can be difficult to find solutions to specific problems. It can also be expensive to learn for first-time developers. In addition, there are limitations on flexibility and customizability that should be considered. There may also be room for improvement in community activity and developer popularity.

Overall, beego is versatile and suitable for large-scale application development. However, it presents some challenges and should be considered if it fits your particular requirements and development environment.

Iris

Express.js-like, Go language framework. If you have experience developing with Node.js, it is the best framework with a low learning cost.

It saves you the time of choosing multiple packages and lessens the burden on developers by taking advantage of the already bundled features that are so feature rich.

As for the functions, the following are already introduced, and all you have to do is import and use those functions at the development stage. It also adopts MVC framework architecture.

-Sessions

  • API versioning
  • WebScoket
  • dependency injection
  • WebAssembly

merit

  1. Express.js-like framework Coding similar to Express.js, a Node.js framework, is possible. Anyone who has used Express.js should be able to pick it up easily.
  2. MVC architecture It uses an MVC architecture, which makes it easy to manage code and separate roles between developers and designers.
  3. Various functions are bundled The functions required for development are bundled in advance, and can be used simply by importing those functions. Since there is no need to select a Go language package again, development can be done very efficiently.

Demerit

  1. Documentation and Resource Limitations Iris can have limited documentation and resources compared to some other popular frameworks. You may have trouble finding a solution to your particular problem. Also, the community may be small and the response to support and feedback may be slow.

  2. Learning costs Iris can have a high learning cost compared to other frameworks. Especially for developers new to Express.js, it can take some time getting used to new coding styles and concepts.

  3. Limited flexibility Iris has limited flexibility compared to other frameworks. While using the pre-bundled functionality is convenient, it may have limitations when customizing it for your particular development style and needs.

Environment

go get github.com/kataras/iris/v12@master # or @v12.2.0-alpha2

Sample code

package main
import "github.com/kataras/iris/v12"

func main() {
app := iris.New()
  booksAPI := app.Party("/books") {
    booksAPI.Use(iris.Compression)
    // GET: http://localhost:8080/books
    booksAPI. Get("/", list)
    // POST: http://localhost:8080/books
    booksAPI. Post("/", create)
  }
  app.Listen(":8080")
}

  // Book example.
  type Book struct {
    Title string `json:"title"`
  }

  func list(ctx iris.Context) {
    books := []Books {
    {"Mastering Concurrency in Go"},
    {"Go Design Patterns"},
    {"Black Hat Go"},
  }

  ctx.JSON(books)
  // TIP: negotiate the response between server's priorities
  // and client's requirements, instead of ctx.JSON:
  // ctx.Negotiation().JSON().MsgPack().Protobuf()
  // ctx. Negotiate(books)
  }
  func create(ctx iris.Context) {
    var b Book
    err := ctx.ReadJSON(&b)
    // TIP: use ctx.ReadBody(&b) to bind
    // any type of incoming data instead.
    if err != nil {
      ctx.StopWithProblem(iris.StatusBadRequest, iris.NewProblem().
      Title("Book creation failure").DetailErr(err))
      // TIP: use ctx.StopWithError(code, err) when only
      // plain text responses are expected on errors.
      return
  }
  println("Received Book: " + b.Title)
  ctx.StatusCode(iris.StatusCreated)
}

Author Rating Iris is a Go language framework that can be developed with a coding style similar to Express.js, and its many features and support for MVC architecture are attractive. In addition, the large number of bundled functions reduces the burden on developers and enables efficient development.

However, there are limitations in documentation and resources, high learning costs, and limited flexibility. The lack of documentation and resources compared to other frameworks may limit problem solving and development support. You should also consider the high learning cost of getting used to new coding styles and concepts, and the limited customizability.

Overall, Iris is an attractive choice for developers who prefer a development style like Express.js, but it does come with some limitations and challenges. It is important to consider whether it fits the developer’s requirements and preferences, and then decide whether it is worth using.

Echo

A framework created by Labstack. Echo is a micro-framework, lightweight and very simple. Only the minimum necessary functions are provided, and you can select and include only what you need for your product.

Echo also supports HTTP/2 for excellent performance and fast delivery of valuable content to users.

merit

  1. Microframework Since only the minimum necessary functions are provided, the necessary functions can be customized according to the product without conflicting with other functions.
  2. Support for creating middleware Echo supports creating middleware. Middleware can describe the processing that must be executed between each function. As a result, development efficiency and code shortening can be expected.

Demerit

  1. Documentation and Resource Limitations Echo can have limited documentation and resources compared to some other popular frameworks. You may have trouble finding a solution to your particular problem. Also, the community may be small and the response to support and feedback may be slow.

  2. Limitation of functionality Echo is a micro-framework and provides bare-bones functionality. Therefore, when developing large applications, you may need to implement additional features and tools yourself.

  3. Learning costs Echo can have a high learning cost compared to other frameworks. In particular, it may take some time to get used to the design philosophy of the micro-framework and how to operate the echo context.

Environment

go get github.com/labstack/echo/v4

Sample code

package main

import (
  "github.com/labstack/echo/v4"
  "github.com/labstack/echo/v4/middleware"
  "net/http"
)

func main() {
  // Echo instances
  e := echo.New()

  //Middleware
  e.Use(middleware.Logger())
  Use(middleware.Recover())

  // Routes
  e. GET("/", hello)

  // Start server
  e.Logger.Fatal(e.Start(":1323"))
}

// Handlers
func hello(c echo.Context) error {
  return c.String(http.StatusOK, "Hello, World!")
}

Author Rating Echo is a simple, lightweight micro-framework that allows you to pick and choose only the features you need. Suitable for developing microservices and small applications. It also has functions that improve development efficiency, such as supporting the creation of middleware.

However, limitations of documents and resources, limited functions, and high learning costs pose challenges. The lack of documentation and resources compared to other frameworks may limit problem solving and development support. Also, large-scale application development may require the implementation of additional features and tools.

Overall, Echo is a simple micro-framework that is easy to use and suitable for developing lightweight applications. However, if you have a large project or need scalability, you should consider other frameworks.

Fiber

An Express.js-like Go language framework. Low memory usage and rich routing. It is heavily influenced by Express.js and is a framework that combines the ease of use of Express.js with the performance of raw Go. Therefore, it can be said that it is currently the fastest and easiest to use Go language framework.

It also supports static content caching and WebSocket bi-directional TCP connections, making it a very powerful choice for building real-time web applications.

merit

  1. Express.js-like framework It can be developed in a style similar to Express.js, which is a node.js framework. If you’ve used Express.js before, it’s easy to catch up.
  2. Full support for Web Sockets and static content caching Since functions are supported by default, there is no need to select or install modules.

Demerit

  1. Documentation and Resource Limitations Fiber is a relatively new framework and may have limited documentation and resources compared to some other popular frameworks. You may have trouble finding a solution to your particular problem. Also, the community may be small and the response to support and feedback may be slow.

  2. Low maturity Fiber is a relatively new framework and is not yet mature. As such, it may not be as stable or reliable as other mature frameworks.

Environment

go get -u github.com/gofiber/fiber/v2

Sample code

func main() {
  app := fiber.New()
  // GET /api/register
  app.Get("/api/*", func(c *fiber.Ctx) error {
    msg := fmt.Sprintf("✋ %s", c.Params("*"))
    return c. SendString(msg) // => ✋ register
  })
  // GET /flights/LAX-SFO
  app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
    msg := fmt.Sprintf("💸 From: %s, To: %s", c.Params("from"), c.Params("to"))
    return c.SendString(msg) // => 💸 From: LAX, To: SFO
  })
  // GET /dictionary.txt
  app.Get("/:file.:ext", func(c *fiber.Ctx) error {
    msg := fmt.Sprintf("📃 %s.%s", c.Params("file"), c.Params("ext"))
    return c.SendString(msg) // => 📃 dictionary.txt
  })
  // GET /john/75
  app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) error {
    msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
    return c.SendString(msg) // => 👴 john is 75 years old
  })
  // GET /john
  app.Get("/:name", func(c *fiber.Ctx) error {
    msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
    return c.SendString(msg) // => Hello john 👋!
  })
  log.Fatal(app.Listen(":3000"))
}

Author Rating

Fiber is a fast and easy-to-use Golang framework, featuring a simple API design inspired by Express.js. It also has features useful for real-time web application development, such as static content caching and WebSocket support.

However, since it is still a new framework, it has the disadvantage that the degree of documentation and resources is low compared to other frameworks, and the degree of maturity is also low. However, Fiber is growing rapidly and we expect further improvements in the future.

Overall, Fiber is a recommended framework if you value fast performance and ease of use. However, it should be considered according to project requirements and maturity criticality.

summary

Each framework has advantages and disadvantages, so it is recommended that you carefully examine and choose one when using it for development.