Code · Writing · Books

Turn scattered articles into a book

Featured books

All books →

Latest posts

33 min read

A Gentle Introduction to Python

Learn Python 3 with a single article — installation, basic types (strings, ints, lists, dicts), control flow (if, for, while), composite types (classes, methods), functional programming, object-oriented programming, error handling (try/except/finally), pip and third-party packages, and how to write unit tests.

5 min read

Go Context: A Quick Guide to Concurrency Control

WaitGroup and channels are two common ways to control concurrency, but for complex scenarios Context is a more elegant mechanism. Context provides four control mechanisms: WithCancel, WithValue, WithTimeout and WithDeadline.

6 min read

A Quick Guide to mmap in Go

mmap maps a file or device into memory — a one-to-one mapping between the file's on-disk address and a range of the process's virtual address space. Reading or writing that mapped memory reads or writes the file at the corresponding position. This tutorial shows how to use mmap in Go.

5 min read

A Quick Guide to gomock

gomock is the official Go mocking library for unit tests, useful when dependencies such as network requests, databases or file I/O are complex and hard to call directly. This tutorial covers matchers (Any, Nil, Not, Eq), return values (Do, Return, DoAndReturn), call counts (Times) and ordering (InOrder), and how to write mockable code.

11 min read

Go Test: Unit Testing in Go

How to write unit tests in Go with the standard library testing package: subtests, table-driven tests, helper functions, setup and teardown, network/HTTP testing and benchmarks.

9 min read

A Quick Guide to Go WebAssembly (Wasm)

Front-end development with Go, WebAssembly and GopherJS: registering functions, interacting with browser JavaScript objects, manipulating DOM elements, asynchronous programming with callbacks, plus more advanced demos (games, rendering) and related projects and documentation.