#Golang

66 articles

Using Workspace Mode with Go's Multi-Module Structure
Application 2024-01-19

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.

#Golang
Distributing Go Applications with GoReleaser
Application 2023-11-11

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.

#Golang#GitHub Actions
Side Effects of Go's response.WriteHeader
Application 2023-09-11

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.

#Golang#Tips
Proposal to Extend ServeMux Functionality in Go Accepted
Application 2023-08-31

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.

#Golang#Router#HTTP
100 Tips for Go: How to Address Common Developer Mistakes
Application 2023-08-27

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.

#Golang#Book Review
About Go's http.RoundTripper
Application 2023-08-22

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.

#Golang
Distributed Services with Go
Application 2023-08-18

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.

#Golang#Book Review
Practical Go Language
Application 2023-08-05

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.

#Golang#Book Review
Improving Code Performance with Go
Performance 2023-06-12

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.

#Golang
How to Use pprof Without DefaultServeMux
Application 2023-04-30

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.

#Golang#Tips
Prevent URL Encoding in Go's html/template
Application 2023-04-23

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.

#Golang#Tips
Cross-Compiling Go Application Images with buildx
Application 2023-04-20

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.

#Golang#Docker
Relearning Go
Application 2023-01-23

Relearning Go

Strengthen Go coding skills by reviewing comprehensive language specifications, generics implementation, and Go 1.18+ features thoroughly.

#Golang
Implemented a Benchmark for Comparing Go HTTP Routers
Application 2022-12-20

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.

#Golang
Practical Introduction to Go Programming: Creating Web Applications from Scratch with the Standard Library
Application 2022-11-23

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.

#Golang#Book Review
Implementing Slack App Slash Command Using Cloud Functions
Application 2022-09-19

Implementing Slack App Slash Command Using Cloud Functions

Implement Slack app slash commands using Google Cloud Functions with Go, Slack API, and serverless architecture.

#Slack Bot#Slack#Golang#Google Cloud Platform#Cloud Functions
Static Analysis of Clean Architecture Layers in Go
Application 2022-09-04

Static Analysis of Clean Architecture Layers in Go

Enforce clean architecture layer dependencies in Go using go-cleanarch for static analysis and architecture validation.

#Golang#Clean Architecture
Technologies Supporting bmf-tech
Architecture 2022-08-08

Technologies Supporting bmf-tech

Explore Docker, Golang, Vue.js, Nginx, Prometheus, and Grafana powering modern blogging infrastructure and monitoring systems.

#Docker#Docker Compose#VPS#Golang#Vue.js#Prometheus#Promtail#Loki#Grafana#Nginx
Implementing a Load Balancer in Golang
Application 2022-01-01

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.

#Golang#Load Balancer#Round Robin
Introduction to Building an HTTP Router with net/http
Application 2021-10-24

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.

#Golang#HTTP