#Golang
66 articles
Using Workspace Mode with Go's Multi-Module Structure
Learn how Go Workspace mode (Go 1.18+) simplifies multi-module development. Covers go work init, go.work file structure, and referencing local modules without editing go.mod.
Distributing Go Applications with GoReleaser
An article on how to cross-compile a Go application and distribute it as binaries using GoReleaser. After explaining what GoReleaser is, it walks through the steps of configuring it and actually producing a release.
Side Effects of Go's response.WriteHeader
Learn why calling Go response.WriteHeader multiple times triggers the superfluous call warning. Covers how the first status code wins and how to fix duplicate WriteHeader in HTTP handlers.
Proposal to Extend ServeMux Functionality in Go Accepted
The proposal to add dynamic routing and path parameters to Go net/http ServeMux was accepted. Learn what this means for third-party routers like goblin and the future of routing in Go.
100 Tips for Go: How to Address Common Developer Mistakes
A review of 100 Go Mistakes and How to Avoid Them. A book that comprehensively covers common Go pitfalls as 100 tips. A handy reference for those already comfortable writing Go who want to raise their code quality another notch.
About Go's http.RoundTripper
Learn what Go http.RoundTripper interface is and how to use it as HTTP client middleware. Includes a custom RoundTripper for request logging and response latency measurement.
Distributed Services with Go
A review of Distributed Services with Go. A hands-on book for building distributed services in Go. It deepens practical understanding of modern techniques in a microservices context, the reasoning behind architectures, and how to implement them.
Practical Go Language
A review of Practical Go Language. Even for those who have written Go for a while, a book that surfaces practical knowledge you did not know or had forgotten. From fine conventions like naming error types to the standard practices worth knowing when writing Go professionally, it covers a broad range.
Improving Code Performance with Go
Learn practical Go performance optimization: pprof profiling, benchmark tests, escape analysis, memory allocation reduction, and real examples from optimizing a custom HTTP router.
How to Use pprof Without DefaultServeMux
A note on how to use Go's net/http/pprof with a custom router instead of the DefaultServeMux. It covers the common pitfall that a blank import alone won't work, and shows how to register handlers such as pprof.Index on your own router so you can still profile performance.
Prevent URL Encoding in Go's html/template
Learn why Go html/template auto-encodes URLs and how to use template.URL to pass raw URLs in templates without triggering automatic HTML encoding. Includes a minimal working example.
Cross-Compiling Go Application Images with buildx
Learn Docker buildx multi-architecture compilation for Go apps. Build cross-platform images for Linux AMD64 and ARM64 targets.
Relearning Go
Strengthen Go coding skills by reviewing comprehensive language specifications, generics implementation, and Go 1.18+ features thoroughly.
Implemented a Benchmark for Comparing Go HTTP Routers
An article about a benchmarking tool I built to compare the performance of various Go HTTP routers. By designing multiple test cases such as static routes and routes with path parameters, it measures and compares the performance differences between the routers.
Practical Introduction to Go Programming: Creating Web Applications from Scratch with the Standard Library
A review of Practical Introduction to Go Programming. A book for learning, hands-on, how to build web applications from scratch using only Go's standard library. Without relying on frameworks, you understand mechanisms like HTTP and templates by building them yourself.
Implementing Slack App Slash Command Using Cloud Functions
Implement Slack app slash commands using Google Cloud Functions with Go, Slack API, and serverless architecture.
Static Analysis of Clean Architecture Layers in Go
Enforce clean architecture layer dependencies in Go using go-cleanarch for static analysis and architecture validation.
Technologies Supporting bmf-tech
Explore Docker, Golang, Vue.js, Nginx, Prometheus, and Grafana powering modern blogging infrastructure and monitoring systems.
Implementing a Load Balancer in Golang
Implement a round-robin L4 load balancer in Go from scratch. Covers reverse proxy with httputil, round-robin scheduling, and active and passive health checks.
Introduction to Building an HTTP Router with net/http
This article explains how to create a custom HTTP router using Golang's standard package net/http.