Best of Golang2024

  1. 1
    Article
    Avatar of gcgitconnected·2y

    I Built a 2D Game in 40 Minutes with Ebiten

    A business analyst who has led multiple development teams shares their experience of building a 2D game called 'Scorpions and Ferraris' in 40 minutes using Golang and the Ebiten library. The game, inspired by Frogger, features a scorpion avoiding cars to reach the other side of the screen. The post includes detailed steps for setting up the development environment, creating the game structure, and implementing game logic. Additionally, it discusses the use of Paint.net for modifying graphics.

  2. 2
    Article
    Avatar of lobstersLobsters·2y

    I'm a programmer and I'm stupid

    A programmer shares their experience of feeling limited in their mental capacity and discusses their approach to programming with simple languages and minimal dependencies.

  3. 3
    Article
    Avatar of awegoAwesome Go·2y

    Learning Go in 2024; From Beginner to Senior

    A comprehensive list of resources for learning and improving Go programming skills, from beginner to senior level. Includes books, video courses, tutorials, and more.

  4. 4
    Article
    Avatar of devtoDEV·1y

    I Tried Every Hot Programming Language

    The author compares their experiences working with GoLang, Zig, and Rust through practical projects. They found GoLang easy to learn and reliable, Zig explicit and fast but lacking memory safety, and Rust challenging due to its strict memory rules but ultimately rewarding. The comparison highlights the strengths and weaknesses of each language and concludes that the best choice depends on specific use cases and team preferences.

  5. 5
    Article
    Avatar of bytebytegoByteByteGo·2y

    EP125: How does Garbage Collection work?

    Garbage collection is a crucial automatic memory management feature used in many programming languages. Java offers multiple garbage collectors tailored to different scenarios, Python employs reference counting alongside a cyclic collector to handle circular references, and GoLang utilizes a concurrent mark-and-sweep garbage collector to minimize application pauses. Additional topics include tools for designing fault-tolerant systems and key system design trade-offs.

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

  7. 7
    Article
    Avatar of lobstersLobsters·2y

    Scaling One Million Checkboxes to 650,000,000 checks

    One Million Checkboxes (OMCB) is a website that scaled from a few expected users to over 650 million checks within days. The architecture involved using Redis for state management, nginx for static content and reverse proxy, and Flask for API handling. The site faced several challenges including unexpected high traffic, Redis connection issues, and bandwidth costs. Solutions included adding more servers, batching updates, using a connection pool, and eventually rewriting the backend in Go, which significantly improved performance. The project emphasized learning and fun over perfect solutions, leading to valuable scaling insights.

  8. 8
    Video
    Avatar of communityCommunity Picks·2y

    I made a multiplayer game from scratch because no one is hiring junior devs.

    A junior developer, frustrated with the job market, built a multiplayer browser game to enhance their resume. The game features turn-based tactics on a 2D hexagonal grid with limited player visibility and a shrinking map. The client-side is developed using TypeScript and HTML5 canvas, while the server-side is implemented in Golang using websockets. The project includes complex features like responsive UI, pathfinding, animations, and real-time multiplayer logic. Despite some challenges, including iOS websocket issues, the game is functional and available to play.

  9. 9
    Article
    Avatar of communityCommunity Picks·2y

    Build Redis from scratch

    This series guides you through building an in-memory database similar to Redis using Go. It focuses on low-level details involving databases, data structures, and algorithms. The project highlights include understanding RESP for command parsing, using goroutines for multiple connections, and implementing data persistence with the Append Only File (AOF) method. Suitable for developers familiar with Go and Redis commands.

  10. 10
    Video
    Avatar of awegoAwesome Go·2y

    Complete Backend Engineering Course in Go

    This course offers a comprehensive guide to backend engineering in Go, covering the creation of a RESTful API from scratch to deployment. It spans from basic concepts like creating a low-level TCP server to advanced topics like authentication, authorization, caching, logging, CI/CD, and deployment to Google Cloud. The course emphasizes understanding core principles, design patterns, and best practices for API development, including the repository pattern, clean architecture, optimistic concurrency control, and more. A free, initial module is available, along with a GitHub repository for further exploration.

  11. 11
    Video
    Avatar of youtubeYouTube·2y

    Complete Backend Engineering Course in Go

    This post introduces a comprehensive backend engineering course in Go, designed to take learners from basic to advanced topics. The course aims to teach how to build RESTful APIs and other backend systems, applying the knowledge to microservices as well. The curriculum includes 21 modules, covering areas such as TCP and HTTP server development, routing, clean layered architecture, database management using the repository pattern, CRUD operations, user authentication and authorization, caching, performance optimization, and CI/CD deployment workflows. The course materials and code are available on GitHub, and the instructor emphasizes understanding concepts over mere code replication.

  12. 12
    Article
    Avatar of awegoAwesome Go·2y

    How I Stopped Worrying and Learned to Love Go Interfaces

    Go interfaces provide a way to define behavior without specifying the method of implementation. They improve code flexibility and cleanliness by allowing different types to satisfy the same interface as long as they implement the required methods. Understanding and using interfaces are essential for scalable and maintainable code. Example implementations include Animal types making different sounds and Shapes calculating area and perimeter.

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

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

  15. 15
    Article
    Avatar of itnextITNEXT·2y

    Performance Benchmarking: gRPC+Protobuf vs. HTTP+JSON

    A performance benchmarking experiment compared gRPC with Protocol Buffers to HTTP with JSON for microservices communication in Go. The tests, run on a local machine, showed that HTTP/2 was slower than gRPC, which in turn was slower than HTTP/1. Despite these results, Protocol Buffers over gRPC remain an effective choice for inter-service communication due to its structured format.

  16. 16
    Article
    Avatar of lobstersLobsters·2y

    Go is my hammer, and everything is a nail

    Markus, a solo developer, advocates for using a single programming language, specifically Go, for all development tasks. He believes that this approach simplifies his tech stack, enhances productivity, and allows him to delve deeper into the language's features. Markus emphasizes that while most popular programming languages can accomplish various tasks, choosing one aligns better with his lifestyle and work preferences.

  17. 17
    Article
    Avatar of devtoDEV·2y

    Go and MongoDB: Building a CRUD API from Scratch

    Learn to build a basic CRUD API using Go and MongoDB, including setup, project structure, model definition, MongoDB connection, and API handlers for create, read, update, and delete operations. Detailed code examples and tips for error handling, security, and database design are provided to help you successfully develop a scalable and efficient web application.

  18. 18
    Article
    Avatar of awegoAwesome Go·2y

    A JavaScript developer tries Go for the first time

    A JavaScript developer shares their first impressions of the Go programming language, highlighting its error handling, defer statement, explicit type conversion, switch statement, pointers, simple type system, and consistent approach to coding.

  19. 19
    Video
    Avatar of dreamsofcodeDreams of Code·2y

    SQLc is the perfect tool for those who don't like ORMs

    SQLc is an efficient tool for developers who prefer writing raw SQL queries over using ORMs. It allows for type-safe SQL query generation, fitting neatly within the repository design pattern. SQLc supports multiple programming languages (TypeScript, Kotlin, Python, and Go) and SQL engines (Postgres, MySQL, SQLite). It eliminates boilerplate code, making database interactions more manageable and reusable across codebases. By using SQLc, developers can maintain full control over queries while ensuring type safety and reducing development time.

  20. 20
    Article
    Avatar of awegoAwesome Go·2y

    Microservices Authentication and Authorization Using API Gateway

    Learn about the challenges of authentication and authorization in a microservices architecture, the benefits of using an API Gateway for access management, and how JSON Web Tokens (JWTs) are used for authentication in microservices.

  21. 21
    Article
    Avatar of communityCommunity Picks·2y

    6 unique and lesser-known Go techniques

    This post explores six unique and lesser-known techniques in Go (Golang): the use of the go generate command for automating code generation, the power of build tags for conditional compilation, the Functional Options pattern for flexible configuration, error wrapping for enhanced error context, the use of context for managing cancellations and timeouts, and JSON tagging for precise control over data marshaling and unmarshaling. These techniques help in writing more efficient, idiomatic, and maintainable Go code.

  22. 22
    Article
    Avatar of gcgitconnected·2y

    Why Use GoFr for Golang Backend?

    GoFr is a Golang framework designed for accelerated microservice development. It offers built-in observability tools such as health-check and heartbeat URLs, metrics, and structured logging. GoFr supports multiple data sources including MySQL, PostgreSQL, and MQTT, and simplifies REST API design, logging, metrics, tracing, and CORS configuration. Its compatibility with Kubernetes and minimal code for route registration enable developers to focus on business logic while ensuring the application is production-ready.

  23. 23
    Article
    Avatar of awegoAwesome Go·2y

    How I sent 500 million HTTP requests to 2.5 million hosts

    An individual leveraged Go's simplicity and concurrency to send 500 million HTTP/1.1 requests to 2.5 million hosts for an ethical hacking use case. By utilizing Kubernetes for horizontal scaling and optimizing both code and libraries, they achieved this massive scale efficiently. Key optimizations included pre-resolving DNS, hand-crafting HTTP requests, and using the fasthttp library.

  24. 24
    Article
    Avatar of communityCommunity Picks·2y

    Model Validation in Golang

    Model validation is essential for ensuring the integrity of software. Golang's validator v10 library is highly recommended due to its extensive features and large community support. The post details how to use field tags, custom validation functions, and offers best practices for fail-fast methodology and avoiding global state. Practical examples demonstrate the use of validation tags and custom struct validation, making the process straightforward and efficient.

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

    Database Transactions in Go with Layered Architecture

    This post explores handling database transactions in Go while adhering to layered architecture principles. It emphasizes the importance of keeping critical logic separate from SQL queries using patterns such as the Repository pattern, the UpdateFn pattern, and the Transaction Provider pattern. Various approaches to transaction management are discussed, highlighting their advantages and drawbacks to help maintain code clarity and integrity.