Best of Awesome GoFebruary 2025

  1. 1
    Article
    Avatar of awegoAwesome Go·1y

    ByteDance/Sonic: A Lightning-Fast JSON Library for Go

    ByteDance's Sonic is a high-performance JSON library for Go, designed to handle the immense scale of TikTok's services. It significantly reduces CPU usage and memory allocations by utilizing techniques like Just-In-Time (JIT) compilation and SIMD instructions. Sonic is demonstrated to be faster and more efficient than the standard encoding/json library, making it an excellent choice for performance-critical applications processing large amounts of JSON data.

  2. 2
    Article
    Avatar of awegoAwesome Go·1y

    Building RAG systems in Go with Ent, Atlas, and pgvector

    Explore how to build a Retrieval Augmented Generation (RAG) system using Go with Ent, Atlas, and pgvector. The tutorial covers setting up a Golang module, defining database schema with Ent, configuring PostgreSQL with Docker, and managing the schema with Atlas. It also includes steps to scaffold a CLI application, load documents into the database, create embeddings using the OpenAI API, and implement a question-asking feature that returns context-aware responses.

  3. 3
    Article
    Avatar of awegoAwesome Go·1y

    How to Use the New tool Directive in Go 1.24

    Go 1.24 introduces the 'tool' directive, making it easier to manage tool dependencies like linters and generators in Go projects. The directive distinguishes tool dependencies from code dependencies, allows version management, and simplifies workflows. Learn how to update your go.mod file to include tools and follow best practices for version pinning and documentation.

  4. 4
    Article
    Avatar of awegoAwesome Go·1y

    Recover panics in all Goroutines you start

    Panics in Go Goroutines can cause server crashes if not properly handled. Implementing a helper function, CatchPanic, for panic recovery ensures that errors are logged and the application continues running. Wrapping all manually created Goroutines with this helper can prevent entire application crashes and assist in diagnosing issues.