Best of Awesome GoMay 2025

  1. 1
    Article
    Avatar of awegoAwesome Go·1y

    The Art of Resource Pooling in Go

    Resource pooling is a design pattern aimed at improving performance and stability by reusing instances to avoid the overhead of frequent creation and destruction. This post focuses on the connection pool implementation in Go's database/sql package, highlighting key pooling strategies such as resource lifecycle management, concurrency-safe design, and exception handling. Recommendations for optimizing performance and preventing common mistakes are also discussed, with insights into monitoring pool metrics effectively.

  2. 2
    Article
    Avatar of awegoAwesome Go·1y

    Build your own ResponseWriter: safer HTTP in Go

    Learn how to build a custom ResponseWriter in Go to prevent common HTTP handling errors, such as forgetting status codes or improperly modifying headers. This guide shows how to wrap the ResponseWriter to enforce custom rules, making HTTP handlers more secure and maintainable.

  3. 3
    Article
    Avatar of awegoAwesome Go·51w

    JSON Web Tokens in Go

    JWT (JSON Web Tokens) is an open standard for securely transmitting information between parties. The guide covers JWT structure (header, payload, signature), explains the difference between symmetric (HS256) and asymmetric (RS256) signing methods, and provides a complete Go implementation using the golang-jwt library and Echo framework. It demonstrates how to generate RSA keys, create a login endpoint that issues JWTs, implement middleware for token verification, and follows security best practices including using RS256 signing and HTTPS.

  4. 4
    Article
    Avatar of awegoAwesome Go·1y

    A Story of Building a Storage-Agnostic Message Queue

    The post describes the journey of developing VarMQ, a versatile, storage-agnostic message queue system in Golang. Initially started as a learning project, the author identified the need for persistence and flexibility in storage solutions, leading to the creation of VarMQ. This queue system adapts to various databases like Redis, SQLite, and more, allowing developers to scale and manage persistence without tying to a particular database. The author emphasizes the importance of feedback and simplicity in development.