Building OAuth 2.0 From Scratch in Go — Part 1: The Authorization Code Flow

Building OAuth 2.0 From Scratch in Go — Part 1: The Authorization Code Flow You’ve clicked “Log in with Google” a hundred times. This is what’s happening on the other side — built from scratch, in three small Go servers you can run yourself. Why build it instead of reading about it OAuth 2.0 has a reputation for being confusing, and I think the reason is that most explanations start with the vocabulary — “resource owner,” “bearer token,” “grant type” — before you have anything to hang it on. So I did the opposite: I built the whole thing. Three tiny Go programs, three roles, one flow, end to end. By the time the photos showed up in the browser, the vocabulary had explained itself. ...

June 10, 2026 · 12 min · Anil Paudel

Layered Error Handling in Go

When I started building HTTP services in Go, my error handling was a mess — and I didn’t notice until the project got big enough to hurt. Every handler decided its own HTTP status. One endpoint returned 400 for a missing record; another returned 404 for the same thing. Validation errors came back in the raw shape of the validator library. My repository returned plain errors.New("not found") strings that the handler had to pattern-match. And one memorable afternoon I found a raw Postgres error — table names and all — sitting in a JSON response I’d shipped to the frontend. ...

June 1, 2026 · 12 min · Anil Paudel

Building a gRPC CRUD Application in Go: A Complete Guide

Building a gRPC CRUD Application in Go: A Complete Guide In this guide, I’ll walk you through implementing a gRPC-based banking application in Go, covering everything from protocol buffer definitions to database integration and testing. Project Overview This project demonstrates a full-featured CRUD application with the following capabilities: Customer account management (Create, Read, Update, Delete, List) Bank account operations Transaction processing and statement generation OAuth 2.0 JWT-based authentication (coming in future parts) Getting Started Project Initialization First, create your project directory and initialize the Go module: ...

December 27, 2025 · 8 min · Anil Paudel