Best of GolangJanuary 2025

  1. 1
    Article
    Avatar of awegoAwesome Go·1y

    Making Beautiful API Keys

    To improve the aesthetic and usability of API keys, a startup created 'uuidkey', a package that encodes UUIDs into a readable format using Crockford Base32. This solution aims to provide secure, globally unique, sortable, and human-friendly API keys by leveraging the benefits of UUIDv7 and adding options such as removing dashes and adding prefixes for better management and security. The package is open source and available for programmers to implement in their own systems.

  2. 2
    Article
    Avatar of communityCommunity Picks·1y

    Making Beautiful API Keys

    Developers are often dissatisfied with the aesthetics and usability of conventional API keys. A startup focused on developer-first solutions created a new package called 'uuidkey' to solve this problem. This package encodes UUIDv7 using Crockford Base32 and adds dashes for symmetry and readability. These keys are secure, globally unique, sortable, and more visually appealing. The keys are also performant in PostgreSQL and designed for easy implementation.

  3. 3
    Article
    Avatar of awegoAwesome Go·1y

    Learn Golang in 2025, You Won't Regret It

    LiveAPI, an auto-API doc generation tool, is being built using Golang. Initially designed at Google in 2009, Go offers unique features like lightweight concurrency with goroutines, built-in communication using channels, simple cleanup with defer, implicit interface implementation, and native error handling with multiple return values. These features, among others, make Golang a strong choice for developers, especially those transitioning from languages like Python and Node.js.

  4. 4
    Article
    Avatar of hnHacker News·1y

    Build a Database in 3000 Lines with 0 Dependencies

    Building complex systems like databases can be simplified by focusing on core ideas. The post outlines constructing a minimalist database in 3000 lines of Go code, discussing concepts such as power-loss atomicity, using data structures like B+trees, managing storage with free lists, and implementing crucial features like range queries, secondary indexes, concurrency control, and a SQL-like query language. The process is incremental, making it an effective learning exercise.

  5. 5
    Article
    Avatar of antonzAnton Zhiyanov·1y

    Go 1.24: Interactive tour

    Go 1.24, scheduled for release in February, brings a wealth of new features, including generic type aliases, weak pointers, improved finalizers, and directory-scoped filesystem access. Performance enhancements are seen in the new map implementation using SwissTable and concurrent hash-trie for sync.Map. Developer experience is improved with streamlined tools for benchmarks, concurrent code testing, custom tool usage, and structured JSON output for build and test commands. Additionally, cryptographic functions see updates with SHA-3 and random text generation.

  6. 6
    Article
    Avatar of antonzAnton Zhiyanov·1y

    Gist of Go: Context

    The post explains the use of context in Go programming, specifically highlighting its role in concurrent operations. It discusses how to implement cancellation and timeout mechanisms using the context package, comparing it to traditional channel-based cancellation. The post also covers practical examples and nuances, such as layers of context, safe multiple cancels, parent-child timeouts, and context with values.

  7. 7
    Article
    Avatar of communityCommunity Picks·1y

    Maps are faster in Go 1.24

    Go 1.24 introduces a Swiss Table-based map implementation, enhancing performance for map operations. Swiss Tables, known for their compactness and efficiency, reduce cache misses and improve memory usage. Despite slightly slower deletion times, lookups, insertions, and handling densely populated maps are significantly faster. This upgrade requires no code changes, benefiting applications like database indexing, caching systems, and data analytics.

  8. 8
    Article
    Avatar of lnLaravel News·1y

    GGH is a Lightweight CLI to Recall Your SSH Sessions

    GGH is a lightweight CLI tool that helps recall SSH sessions and search your SSH configuration file. Compatible with Unix and Windows systems, it wraps SSH commands for easy session management without replacing SSH. The project is available on GitHub with installers for both operating systems.

  9. 9
    Article
    Avatar of awegoAwesome Go·1y

    Scaling LLMs with Golang: How we serve millions of LLM requests

    Using Golang for production deployments of LLMs has proven efficient for handling millions of requests. Key benefits include its type safety, concurrency with goroutines, and composable interfaces. Despite Python's dominance in ML development, combining it with Golang allows leveraging both languages' strengths for a robust and scalable system.

  10. 10
    Article
    Avatar of golangnutsGo Developers·1y

    Golang + observability = backend applications that you'll love ❤️

    Yokai is a simple, modular, and observable Go framework designed to help developers avoid boilerplate code in production-grade backend applications. It includes features such as logs, traces, metrics, health checks, and config management. The framework offers demo applications and tutorials to assist developers in getting started.

  11. 11
    Article
    Avatar of devgeniusDev Genius·1y

    Common Go Programming Pitfalls: How to Avoid Them

    Go, while powerful and efficient, has several common pitfalls. Misusing init functions, interface overuse, misunderstanding range loops, inefficient string concatenation, improper use of receivers, and underestimating the value of named result parameters can all degrade code quality. Recognizing and addressing these issues can lead to more maintainable and performant Go programs.

  12. 12
    Video
    Avatar of awegoAwesome Go·1y

    Make an MMO with Godot 4 + Golang: Database setup for persistent game world

    Learn how to set up a SQLite database for a Godot 4 MMO using Golang. This guide covers establishing a connection, handling user registration and login, and writing SQL queries without using an ORM. Follow along to implement a secure and persistent game world. By the end of this tutorial, you'll have a functioning login system and the groundwork for more complex game logic.

  13. 13
    Article
    Avatar of awegoAwesome Go·1y

    How to Make Go Structs More Efficient

    Go structs with identical fields can differ in memory usage due to data alignment and field ordering. By reordering fields, significant memory savings can be achieved. This technique is called structure packing. The Go tool 'fieldalignment' can automatically optimize struct field order to ensure efficient memory usage.

  14. 14
    Article
    Avatar of golangnutsGo Developers·1y

    11 tips for structuring your Go projects

    Learn 11 tips to effectively structure your Go projects for better organization and maintainability. The guidance covers various aspects, from organizing directories and files to best practices in coding and project management.

  15. 15
    Article
    Avatar of awegoAwesome Go·1y

    A Deep Dive into Gin: Golang's Leading Framework

    Gin is a high-performance HTTP web framework written in Go. It offers superior speed compared to the Martini framework due to its use of `httprouter`, and provides features like middleware support, crash-free execution, JSON validation, route grouping, error management, and built-in rendering functions. Developers can quickly get started with Gin's straightforward API. The framework uses radix trees for fast routing and efficient middleware processing. Gin's `ServeHTTP` method handles HTTP requests, utilizing context management to ensure smooth request handling, even in the event of errors. The post also promotes Leapcell, a serverless platform ideal for deploying Gin-based applications.

  16. 16
    Article
    Avatar of communityCommunity Picks·1y

    SQL Transactions in Go: The Good Way

    Learn about an efficient way to manage database transactions in a Go codebase using the transactor library. This approach allows for the safe and transparent use of transactions within business logic without exposing database internals, supporting multiple relational databases and nested transactions. Includes a detailed implementation and example usage.

  17. 17
    Article
    Avatar of mtlynchMichael Lynch·1y

    if got, want: A Simple Way to Write Better Go Tests

    Learn a simple and effective way to write better Go tests using the 'if got, want' pattern. This method enhances readability and reduces errors by clearly distinguishing between test assertions and logic. It works especially well in table-driven tests and avoids the need for third-party test libraries. The post provides several examples demonstrating the technique.

  18. 18
    Video
    Avatar of primeagenThePrimeTime·1y

    Picking A Language In 2025

    Choosing a programming language post-2025 is challenging due to the rapidly evolving landscape. The author, who has previously worked with Rust and Go, is exploring alternatives like Zig, Odin, and JAI. There's a strong emphasis on languages that support metaprogramming. The discussion also highlights the frustrations with some languages' complexity and the uncertainty of adopting new ones during a period of fast-paced developments.

  19. 19
    Article
    Avatar of awegoAwesome Go·1y

    Clean Architecture: A Practical Example of Dependency Inversion in Go using Plugins

    The Dependency Inversion Principle (DIP) is crucial for maintainable software architecture, yet often neglected. Go’s plugin system provides a practical implementation of DIP by enabling modularity and extension without recompilation. This approach aligns with Clean Architecture principles and offers benefits such as simplified deployment and isolation of components. The post illustrates a proof-of-concept where plugins modify data through a transformer interface, reinforcing the importance of dependency on abstractions.

  20. 20
    Article
    Avatar of golangnutsGo Developers·1y

    Resources to learn Golang

    A compilation of various resources to learn Golang, including online courses, YouTube channels, documentation, and GitHub projects. The resources offer comprehensive guides and practical examples to enhance Golang skills.

  21. 21
    Article
    Avatar of awegoAwesome Go·1y

    Testable Examples in Go

    Testable examples in Go allow code snippets to be used as package documentation and verified as part of the test suite. These examples help ensure documentation stays current with API changes. Example functions are special test functions that start with 'Example' and can be run in the Go documentation web interface. Examples include output comments to check expected results, and whole file examples for comprehensive demonstrations.

  22. 22
    Video
    Avatar of dreamsofcodeDreams of Code·1y

    What I've been up to recently...

    The author shares an update on their recent activities, explaining the reasons behind the lack of posts on their channel. They reveal they've been busy building a web application and platform from scratch for an upcoming course using Go. Initially considering off-the-shelf solutions, the author decided to build their own platform to maintain control and avoid expenses. They share insights on the development process, including using the Goth stack, Alpine JS for frontend, and creating a CLI tool for video streaming with HLS. Future plans include more content on their experience and learnings.

  23. 23
    Video
    Avatar of primeagenThePrimeTime·1y

    I Will Not Write Rust Again

    The author expresses a personal decision to stop using Rust for future projects despite appreciating some of its features like enums and serialization. They highlight a preference for Go and exhibit an interest in exploring the Zig language, pointing out its advantages in metaprogramming and performance. The author reflects on their previous positive experiences with C and seeks a similar enjoyment in newer languages, finding Rust less appealing compared to other options.

  24. 24
    Video
    Avatar of tsoding_dailyTsoding Daily·1y

    This Library Turns C into Go

    Libmill is a library that brings Go-like concurrency to C. It uses coroutines and channels to simplify concurrent programming and provide an efficient event-driven model. Despite being almost a decade old and minimally updated, it remains functional and can handle tasks like networking effectively. The library presents a macro-based approach to creating coroutines, similar to Go's goroutines, which is integrated directly into C code, allowing tasks such as I/O operations to be handled asynchronously.

  25. 25
    Article
    Avatar of awegoAwesome Go·1y

    What is Mutex and How to Use it in Golang?

    Mutex, or Mutual Exclusion, is a locking mechanism used in concurrent programming to prevent race conditions by ensuring only one goroutine can access a shared resource at a time. Golang's sync package provides Mutex and RWMutex for managing concurrent job execution. Mutex locks and unlocks critical sections where shared resources are accessed, maintaining data integrity and preventing resource starvation.