Best of GolangFebruary 2025

  1. 1
    Article
    Avatar of hnHacker News·1y

    We Replaced Our React Frontend with Go and WebAssembly

    Dagger Cloud v3 features a new UI built with Go and WebAssembly, replacing the previous React-based frontend. The decision aimed to unify the codebases of the terminal UI and web UI, enhancing performance and reducing duplication. Despite challenges like the Go + WebAssembly combination's maturity and memory limitations, the team achieved a smoother, more consistent user experience. Key optimizations included reducing memory usage and ensuring better performance for large data sets. This approach is particularly beneficial for teams with a strong Go background and complex UIs.

  2. 2
    Article
    Avatar of notedNoted·1y

    Go Cron - A Self Hosted Go Based Task Scheduler with GUI

    GoCron is a Go and Vue.js based task scheduler that simplifies job management through YAML configuration. It supports cron scheduling, environment variables, and comes with pre-installed backup software such as Borg, Restic, and Rclone. Installation can be easily managed using Docker Compose. The simple UI allows manual running of jobs and viewing live logs.

  3. 3
    Article
    Avatar of hnHacker News·1y

    We switched from Java to Go and don't regret it

    Switching from Java/Kotlin to Go proved beneficial with faster startup times, lower resource consumption, and a more lightweight ecosystem. While Java still excels in some areas, Go offers advantages for cloud-native applications and Kubernetes tooling. The transition wasn't as challenging as expected, and the benefits were quickly evident.

  4. 4
    Article
    Avatar of golangnutsGo Developers·1y

    Build a Full-Stack Web App in One File With Golang

    Learn how to create a full-stack web application using Golang, AlpineJS, and TailwindCSS in under 2 hours. This tutorial is perfect for those interested in performant HTML template engines, lightweight backend services, and modern front-end frameworks. Note that this approach is not recommended for large applications.

  5. 5
    Article
    Avatar of hnHacker News·1y

    Tanq16/ExpenseOwl: Extremely simple expense tracker with nice UI. Intended for home lab use.

    ExpenseOwl is a simplified expense tracking system designed for home lab use, featuring a modern pie-chart visualization for monthly expenses and a tabular representation of individual expenses. The application focuses on adding and deleting expenses only, with minimal input fields and customization options via environment variables. It supports single-user deployment, REST API management, and can be installed as a PWA on multiple devices. The backend is built with Go, while the frontend utilizes Chart.js.

  6. 6
    Article
    Avatar of freecodecampfreeCodeCamp·1y

    How to Work with OpenAPI in Go

    OpenAPI is a key standard for defining well-structured APIs in a language-agnostic manner. This guide explains how to architect, implement, and consume APIs using OpenAPI with Go. Covering everything from API design, schema components, and endpoint definitions, to generating server code and API documentation, this guide offers practical examples and tools for effective API management.

  7. 7
    Video
    Avatar of youtubeYouTube·1y

    I deleted all my go projects.

    The author discusses their journey of archiving their Go projects, initially started to write a Docker file linter. They describe the challenges faced with Go's ergonomics and their eventual shift to using Python, but still utilizing Go for certain extensions. The post details issues with Go's runtime, specifically with maintaining multiple C shared libraries, leading to the decision to stop maintaining these projects due to inherent limitations.

  8. 8
    Article
    Avatar of webdevelopementWeb Developement·1y

    Build a Full-Stack Web App in One File!

    Learn how to quickly build a full-stack web application using Golang, AlpineJS, and TailwindCSS. The tutorial focuses on creating a simple project for learning purposes, rather than large-scale application development. Key tools include Templ for HTML templates, AlpineJS for reactive components, and PocketBase for lightweight backend services. The project resources are available on GitHub.

  9. 9
    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.

  10. 10
    Article
    Avatar of programmingdigestProgramming Digest·1y

    Serving a billion web requests with boring code

    Bill Mill shares his experience building a high-traffic Medicare plan comparison website for the US government using PostgreSQL, Go, and React. The system successfully managed about 5 million requests per day with excellent performance, emphasizing simplicity, reliability, and established technologies.

  11. 11
    Article
    Avatar of threedotslabsThree Dots Labs·1y

    We quit our jobs to help people write software more mindfully

    Two high school friends quit their principal software engineer jobs to start a company focused on educating people about software development without VC funding. They previously launched a popular blog and created the Watermill project for event-driven Go services. They've developed various training programs, including 'Go In One Evening' and 'Go Event-Driven,' and now they're building a platform for hands-on learning. Their next plans include launching a live podcast and more online trainings, with a focus on practical, real-world applications of software development.

  12. 12
    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.

  13. 13
    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.

  14. 14
    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.

  15. 15
    Article
    Avatar of hnHacker News·1y

    research!rsc: Go Data Structures

    Understanding the memory layout of basic Go data types, including ints, floats, structs, arrays, strings, and slices, helps new programmers optimize performance. The post explains how data is represented in memory and the differences in memory management between C-style pointers and Go's new and make functions.

  16. 16
    Article
    Avatar of beambloggersBeam Bloggers Webring·1y

    Asdf Has Been Re-Written in Golang

    asdf has been rewritten in Go, resulting in the release of version 0.16.0. The rewrite has made operations significantly faster (2x-7x improvements) and fixed various bugs. The codebase is now more approachable for new contributors. Upgrading to the new version is straightforward and supports older versions' plugin and data compatibility, though users need to follow specific instructions since the API has evolved. The migration to Go has enhanced performance, maintainability, and user experience.

  17. 17
    Article
    Avatar of communityCommunity Picks·1y

    Go 1.24 uses Swiss Table, what are they?

    Go's v1.24 introduced a new hash table implementation called Swiss Table, which improves efficiency and memory usage by using a cache-friendly approach and linear probing with SIMD instructions. Unlike the old Map's chaining strategy, Swiss Table keeps collision data nearby, speeding up comparisons and insertions. A new technique called Elastic Hashing has been proposed, which could potentially offer better performance than the current methods. Benchmarks show significant improvements in lookup and insertion times with the new Swiss Table.

  18. 18
    Article
    Avatar of awegoAwesome Go·1y

    Map internals in Go 1.24

    Go 1.24 introduces a complete rewrite of the map data structure, inspired by Google's Swiss Tables. This new implementation enhances performance through efficient group-based storage and hash-based lookup operations. It uses a combination of control words, hash partitioning, and quadratic probing to optimize key-value access, insertion, and deletion processes. This design allows for distributed storage across tables, reducing congestion and improving lookup speeds.

  19. 19
    Video
    Avatar of bytebytegoByteByteGo·1y

    How the Garbage Collector Works in Java, Python, and Go!

    Effective memory management is crucial to prevent programs from gradually consuming more memory, leading to slower performance and crashes. Garbage collection (GC) addresses this by reclaiming memory no longer used by a program. This concept varies in languages like Java, Python, and Go. Java uses a generational hierarchy dividing memory into the Young Generation, Old Generation, and Metaspace. Python employs reference counting and a cyclic garbage collector, while Go uses a concurrent mark and sweep collector with a tricolor marking algorithm. Each approach aims to balance performance, latency, and scalability while minimizing pause times and handling memory fragmentation.

  20. 20
    Video
    Avatar of lowlevellearningLow Level Learning·1y

    how does this keep happening?

    A backdoor in a Go programming language module was active for over 3 years due to a supply chain attack, exploiting a Go module mirror's caching system. This highlight emphasizes the inherent risks associated with relying on third-party code in languages like Go, Python, Rust, and JavaScript. The attack utilized typo squatting to trick developers into downloading malicious packages. Despite the malicious GitHub package being cleaned up, the security loophole underscores the need for better verification and review processes for cached packages.

  21. 21
    Article
    Avatar of awegoAwesome Go·1y

    Let's Implement Consistent Hashing From Scratch

    Consistent hashing is a key distribution technique used in distributed systems to efficiently map keys to servers, minimizing data movement when nodes are added or removed. This post explains the concept, its importance, and demonstrates an implementation in Golang using a ConsistentHashRing. The implementation covers hashing functions, adding and removing nodes, storing and retrieving data, and handling node removal.

  22. 22
    Article
    Avatar of hnHacker News·1y

    abhinavxd/libredesk: Open source, self-hosted customer support desk. Single binary app.

    Libredesk is an open-source, self-hosted customer support desk application available as a single binary. Key features include multi-inbox support, granular permissions, smart automation, CSAT surveys, macros, SLA management, and AI-assisted response rewriting. The project is currently in alpha, and its setup involves downloading and configuring necessary files, with available integration to business intelligence tools.

  23. 23
    Video
    Avatar of anthonyggAnthony GG·1y

    How I Scaled My App with Distributed Actors & WASM

    The post discusses the development and scaling of the Market Monkey trading terminal using Golang for both the backend and frontend. The application operates as both a desktop and web app via WebAssembly. The backend utilizes distributed actors for service communication and TimescaleDB for time-series data storage. Optimizations for WebAssembly, handling of websocket communications, and future scripting capabilities are also highlighted.

  24. 24
    Article
    Avatar of glwGolang Weekly·1y

    Golang Weekly Issue 543: February 26, 2025

    Go 1.24 introduces a new package for testing concurrent code and enhances Go's WebAssembly capabilities with the ability to export functions to Wasm. The release also includes guidance on managing tool dependencies and introduces a native WebP image support library.