Best of GolangJune 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·2y

    5 small tips I recently learned in Go

    Discover 5 small tips in Go that you may not have known about, including how to make the compiler count array elements, using `go run .`, making numbers more readable with underscores, having a different test package in the same package, and passing the same argument multiple times in string formatting.

  2. 2
    Article
    Avatar of awegoAwesome Go·2y

    Announcing River UI

    River UI provides a user-friendly interface for managing SQL-backed job queues, featuring a backend Go API and a frontend built with React and TypeScript. It allows users to monitor job states, interact by cancelling, retrying, or deleting jobs, and offers features like pausing queues during issues. River UI is available as a Docker image and a pre-built static binary, with future enhancements planned.

  3. 3
    Article
    Avatar of awegoAwesome Go·2y

    Avoiding Beginner Mistakes Hampering You to Scale Backend⚡️

    The post outlines techniques for dramatically scaling backend performance from 50K to 1M requests on minimal resources. Key strategies include building an observability pipeline, performing stress tests, connection pooling, enforcing resource constraints, disabling implicit transactions, adding indexes, handling transaction locks, and increasing file descriptor limits. The backend, developed in Golang with a monolithic architecture using GIN and GORM, underwent significant optimizations to achieve improved efficiency and scalability.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Common Anti-Patterns in Go Web Applications

    Web applications in Go face challenges of maintainability primarily due to strong coupling and misuse of principles like DRY (Don't Repeat Yourself). The post discusses how loose coupling can help maintainability and elaborates on common anti-patterns such as the Distributed Monolith and Single Model anti-pattern. It suggests tactics like separating models for API and storage, generating repetitive boilerplate code, and keeping business logic separate from implementation details to enhance code maintainability and clarity.

  5. 5
    Article
    Avatar of lobstersLobsters·2y

    Go evolves in the wrong direction

    The post discusses the perceived drawbacks of Go's simplicity and lack of advanced features. It highlights the potential increase in complexity and implicit code execution introduced by recent additions such as generics and iterators. The author suggests focusing on Go's essential features like simplicity, productivity, and performance.

  6. 6
    Article
    Avatar of awegoAwesome Go·2y

    7 Common Interface Mistakes in Go

    Learn about common mistakes developers make when working with interfaces in Go and how to avoid them. The post covers key principles like interface segregation, behavior-driven interfaces, and the importance of small, precise interfaces. It also emphasizes avoiding interface pollution by creating interfaces only when needed, and highlights best practices for interface design to ensure simplicity, readability, and organic code growth.

  7. 7
    Article
    Avatar of logrocketLogRocket·2y

    Using PocketBase to build a full-stack application

    Learn how to use PocketBase to quickly build full-stack applications with essential features out of the box. PocketBase is written in Go, making it more performant than Node.js under heavy loads. Integrate GitHub OAuth2 for user onboarding and build a forum-like web application using React and Chakra UI.

  8. 8
    Article
    Avatar of awegoAwesome Go·2y

    Build a chat room with custom bots powered by OpenAI/Gemini

    Build a chat room that combines chat platforms like Discord and Slack with AI bots powered by OpenAI and Google Gemini. This guide walks you through running the application locally, deploying to Encore's free dev cloud, and integrating with Slack/Discord. Key components include an Open Source Go-based application, multi-platform support, and multi-model compatibility with OpenAI and Gemini. Setup involves installing Encore CLI, configuring API keys, local development with a single command, and seamless cloud deployment.

  9. 9
    Article
    Avatar of devtoDEV·2y

    Understanding Go: part 12 – Visibility

    This blog post discusses the concept of 'Visibility' in Go and mentions an illustrated book about Kubernetes and Docker.

  10. 10
    Article
    Avatar of itnextITNEXT·2y

    Go evolves in the wrong direction

    The post discusses the criticism that Go programming language is facing for lacking advanced features from other languages. It highlights the negative impact of adding generics and the 'range over func' feature in recent Go releases, emphasizing the increased complexity and lack of clarity in code. The author suggests focusing on essential Go features like simplicity, productivity, and performance to compete with languages like Rust.

  11. 11
    Video
    Avatar of communityCommunity Picks·2y

    Distributed File Storage In Go – Full Course

    Learn how to build a decentralized file storage system using Go. The course covers system design, low-level programming, and network protocols.

  12. 12
    Article
    Avatar of threedotslabsThree Dots Labs·2y

    Live website updates with Go, SSE, and htmx

    Learn how to push live updates to your website using Go, SSE, and htmx. SSE endpoints in Go are slightly different from HTTP endpoints because you don't just write data to the ResponseWriter and return from the function. The connection stays alive until the client (the browser) closes it.

  13. 13
    Article
    Avatar of awegoAwesome Go·2y

    Why and how you should rate-limit your API

    Rate limiting is essential for managing API traffic, ensuring stability, controlling costs, and protecting against abuse. It involves limiting the number of requests within a specific period (e.g., 100 requests per minute). Various policies, such as fixed window, sliding window, token bucket, and leaky bucket, can be used. Implementing rate limiting correctly is complex and depends on factors like whether it's at the proxy or application level. A practical implementation using Go and Redis employs the leaky bucket policy and provides examples of how to set up and monitor the service.

  14. 14
    Video
    Avatar of codeheimcodeHeim·2y

    #41 Golang - Master Dependency Injection in Go

    Learn about dependency injection in Go and how it can make code easier to change and test. See how to implement dependency injection using interfaces and structures. Explore a bakery example to understand the concept.

  15. 15
    Article
    Avatar of freecodecampfreeCodeCamp·2y

    How to Create Database Migrations in Go Using Docker and Postgres

    Learn how to create and manage database migrations in Go using Docker and Postgres. This guide covers setting up a Docker container, creating a schema with TablePlus, installing golang-migrate, generating migration scripts, and running migrations effectively.

  16. 16
    Article
    Avatar of bitfieldconsultingBitfield Consulting·2y

    Shameless green: TDD in Go — Bitfield Consulting

    A deep dive into Test-Driven Development (TDD) in Go. The post illustrates the 'Shameless Green' approach in TDD, where the primary focus is on passing the test rather than writing perfect code. It explains how to validate and refine tests using the cmp.Diff function for better debugging and demonstrates the utility of table-driven tests in handling multiple test cases efficiently. Ends by stressing the importance of writing new tests for new behaviors.