Best of GolangNovember 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·2y

    Learning Go by examples: part 7 - Create a cross-platform GUI/Desktop app in Go

    This post provides a comprehensive tutorial on how to create a cross-platform GUI/Desktop and mobile application using Golang and the Fyne toolkit. It walks through the initialization process, setup of the Go modules, and detailed steps to code and run the application. It also explains how to package the app for different operating systems and mobile platforms, using Taskfile for automation. The guide demonstrates creating a simple app that displays a random Gopher image and includes a help menu and an about dialog.

  2. 2
    Article
    Avatar of awegoAwesome Go·1y

    Mastering Modern APIs with Go: From Basics to Best Practices🌐💻🚀

    APIs are crucial for modern software development, acting as intermediaries that allow different systems to communicate. This guide explores how to build and consume APIs using Go, highlighting key concepts such as endpoints, HTTP methods, and data formats. It also provides best practices for error handling, security, and rate limiting and includes practical steps for setting up, writing, and testing API code in Go.

  3. 3
    Article
    Avatar of golangnutsGo Developers·2y

    Building a chat app in Go with WebSockets and Nitric

    Learn to build a real-time chat application in Go using WebSockets and Nitric. The guide includes steps for creating a WebSocket API, managing connections, handling WebSocket events, local testing, and deploying to AWS.

  4. 4
    Video
    Avatar of TechWithTimTech With Tim·2y

    Learn Go With This ONE Project

    The post introduces a video tutorial aimed at helping programmers with some experience learn Go quickly through a single project. The project involves building a slot machine, covering both basic and intermediate Go features. It is not suitable for complete beginners but assumes familiarity with basic programming concepts such as loops and functions. Additionally, the post highlights the use of the GoLand IDE, which is tailored for Go development and offers AI-powered code completion.

  5. 5
    Article
    Avatar of hnHacker News·2y

    Writing secure Go code

    Keeping Go code secure involves steps such as subscribing to the Go mailing list for critical updates, keeping Go versions up to date to apply security patches, and using tools like 'go vet', 'staticcheck', 'golangci-lint', and 'govulncheck' to analyze code quality and security. Additionally, checking for race conditions using the '-race' flag, scanning for vulnerabilities with 'govulncheck', and employing fuzz testing are crucial practices. These methods help maintain robust and secure code while ensuring compatibility and addressing potential issues.

  6. 6
    Article
    Avatar of bitfieldconsultingBitfield Consulting·2y

    Rust and Go vs everything else — Bitfield Consulting

    This post features an interview with John Arundel discussing the strengths and differences of Rust and Go programming languages. Rust is known for its safety features and memory management while being more complex to learn. Go is appreciated for its simplicity and efficiency, especially in handling concurrency through goroutines and channels. Arundel emphasizes the importance of learning both languages for comprehensive software development skills in 2024 and beyond.

  7. 7
    Article
    Avatar of communityCommunity Picks·1y

    goravel/goravel: A Golang framework for web artisans. Tribute to Laravel.

    Goravel is a web application framework designed for Golang, offering a range of features and scalability similar to Laravel. It allows PHP developers to quickly adapt to Golang without learning a new framework. Key functionalities include routing, ORM, task scheduling, logging, caching, queues, and more. The project encourages contributions and is licensed under the MIT license.

  8. 8
    Article
    Avatar of hnHacker News·2y

    google/go-safeweb: Secure-by-default HTTP servers in Go.

    The `go-safeweb` library collection aims to create secure-by-default HTTP servers in Go. It addresses issues like XSS, XSRF, CORS, CSP, transport security, and access control through built-in mechanisms. The emphasis is on security with minimal intrusion into existing Go standard library APIs, aiming for easy adoption and high compatibility.

  9. 9
    Article
    Avatar of lobstersLobsters·2y

    What's coming in Go 1.24

    The post highlights new features and improvements coming in Go 1.24, including screen reader support and keyboard shortcuts to enhance developer productivity. It provides insights into upcoming enhancements for accessibility and overall user experience in Go development.

  10. 10
    Article
    Avatar of communityCommunity Picks·2y

    h2non/imaginary: Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing

    Imaginary is a fast, simple, and scalable HTTP microservice written in Go for high-level image processing using the efficient libvips library. It supports multiple image operations through a simple HTTP API and includes features such as API token authorization, URL signature protection, and CORS support. Imaginary can process images from various sources and can be deployed easily using Docker. It also provides mechanisms for image placeholder fallback and HTTP traffic throttling to handle high concurrency and mitigate DDoS attacks.

  11. 11
    Article
    Avatar of communityCommunity Picks·1y

    How To Build A Containerized Microservice in Golang: A Step-by-step Guide with Example Use-Case

    Learn how to build a cloud-native application using Golang and microservices architecture. The guide covers setting up microservices, leveraging the Go-Kit framework, developing APIs using REST and gRPC, and deploying on Azure. Follow along to create a document watermarking service with three microservices: Authentication, Database, and Watermark Service. Detailed steps include project structure, service implementation, and setting up HTTP and gRPC transports.

  12. 12
    Article
    Avatar of awegoAwesome Go·2y

    fmt.Sprintf vs String Concat

    String concatenation in Go is significantly faster than using fmt.Sprintf for formatting, particularly in performance-critical applications such as local server queries. This post explains the performance benefits with benchmarks, discusses how fmt.Sprintf works internally, and explores why string concatenation is more efficient. The author suggests opting for string concatenation in performance-sensitive paths to achieve noticeable improvements.

  13. 13
    Video
    Avatar of codeheimcodeHeim·1y

    #65 Golang - Build REST APIs with Golang and MongoDB

    Learn how to build REST APIs using Golang and MongoDB. The guide covers setting up the MongoDB Go driver, structuring the project using MVC, connecting to the database, and implementing CRUD operations for movie records. The tutorial includes examples of inserting, updating, deleting, and querying data in MongoDB.

  14. 14
    Article
    Avatar of communityCommunity Picks·2y

    cshum/imagor: Fast, secure image processing server and Go library, using libvips

    imagor is a robust image processing server and Go library that utilizes the efficient libvips library, providing 4-8x faster performance than ImageMagick. It supports various image processing use cases through a HTTP server, integrates seamlessly with Docker, and offers video thumbnail capabilities via ffmpeg bindings. imagor can be configured for different storage solutions like HTTP, file system, AWS S3, and Google Cloud Storage, supporting complex image operations and filters with secure URL signing to prevent DDoS attacks.

  15. 15
    Article
    Avatar of medium_jsMedium·1y

    Tuning Go Application, which has GC issues with a few steps

    Working on a project involving Kafka and Google Cloud Storage, the author faced significant GC issues with their Go application compared to the Confluent Google Cloud Sink Connector. By employing techniques like using sync.Pool, preallocating slices, switching to the bytedance/sonic JSON library, and tuning GOGC and GOMEMLIMIT settings, they improved performance, reducing GC pause frequency and time, while increasing CPU utilization and memory usage for better overall efficiency.

  16. 16
    Article
    Avatar of evolvedevevolvedev·2y

    Build scalable web applications in Golang without JavaScript

    This post outlines a setup for building scalable web applications in Golang, minus JavaScript. It covers configuring a simple API with Go Templates, JavaScript bundling without third-party CDNs, and using TailwindCSS & Preline UI. The setup also supports live server and browser reload, with only two dependencies needed. A demo video and GitHub link are provided.

  17. 17
    Article
    Avatar of itnextITNEXT·1y

    Unveiling the garbage collector in Go

    Go’s Garbage Collector simplifies memory management by automatically reclaiming unused memory via a mark-and-sweep algorithm. Introduced in Go 1.5, the concurrent GC minimizes performance issues like stop-the-world pauses. Despite its efficiency, developers need to be aware of patterns that can cause memory leaks. Upcoming posts will delve into maps and slices scenarios to provide a deeper understanding.

  18. 18
    Video
    Avatar of codeheimcodeHeim·2y

    #62 Golang - Mastering Concurrency: Or-Done and Tee Channel Patterns

    In Go, channels provide a robust way to handle concurrent tasks and manage communication between goroutines. This post explores the Or-Done and Tee Channel patterns, demonstrating how to stop multiple goroutines and duplicate channel values. The patterns are explained using a scenario where transaction data is processed by both a fraud detection and a customer analytics pipeline. The Or-Done pattern enables graceful shutdown upon error or cancellation, while the Tee pattern splits data streams for independent processing. Practical code examples illustrate the implementation and benefits of these patterns in real-time data processing.

  19. 19
    Article
    Avatar of changelogChangelog·2y

    Writing a shell in Go with Qi Xiao (Go Time #336)

    Johnny and Qi Xiao discuss the complexities and methods of writing a shell using the Go programming language. They delve into various aspects of the project, offering practical advice and insights for developers interested in undertaking such a feat.

  20. 20
    Article
    Avatar of freecodecampfreeCodeCamp·2y

    How to Build a Flexible API with Feature Flags Using Open Source Tools

    Feature flagging allows backend developers to enable or disable features on the fly without redeploying. This tutorial shows how to build an app using Golang, Redis, and Flagsmith for feature flag management. The app demonstrates dynamic functionality adjustments such as API rate limiting and beta endpoint activation. The process includes coding the API, initializing clients, creating endpoints, and integrating with Flagsmith and GitHub for real-time updates and feature management.

  21. 21
    Video
    Avatar of codeheimcodeHeim·2y

    #63 Golang - Mastering Concurrency: Or-Done and Tee Channel Patterns

    Learn how to use the Cobra CLI package to create powerful command-line tools in Golang. This tutorial guides you through building a simple CLI app that generates hex, base64, or UUID strings. It covers the installation of Cobra, setting up a project structure, creating root and subcommands, and handling flags. Cobra allows you to build complex CLI applications with structured and customizable commands.

  22. 22
    Article
    Avatar of elibenderskyEli Bendersky·2y

    GoMLX: ML in Go without Python

    The post describes implementing machine learning models in Go without using Python, focusing on the GoMLX package. GoMLX leverages XLA and PJRT for core functionalities and provides a Go-friendly interface. The author showcases re-implementations of ML inference tasks, such as a CNN model for the CIFAR-10 dataset and a more complex model like Gemma2, highlighting similar results to Python-based implementations.

  23. 23
    Article
    Avatar of communityCommunity Picks·1y

    Melkeydev/go-blueprint: Go-blueprint allows users to spin up a quick Go project using a popular framework

    Go Blueprint is a CLI tool for quickly setting up Go projects with an established structure and optional integration with popular frameworks. It offers easy installation, support for setting up Go HTTP servers, and a variety of advanced features like HTMX, CI/CD workflows, WebSockets, TailwindCSS, Docker configurations, and React front-ends. Users can choose their preferred database driver and utilize a web-based UI for command creation and project preview.

  24. 24
    Article
    Avatar of jetbrainsJetBrains·2y

    Deploying Go Apps with Kubernetes

    The post provides a comprehensive tutorial on deploying Go applications with Kubernetes. It covers the steps to create a basic Go application, containerize it using Docker, and deploy it to a local Kubernetes cluster using Docker Desktop. The tutorial includes code snippets for setting up the database with GORM, building core business functions, creating and configuring Dockerfiles, writing Kubernetes manifests, and deploying both the database and application. It also offers guidance on interacting with Kubernetes clusters directly from GoLand IDE.