A practical guide for Bash programmers transitioning to Go, focusing on building CLI tools. Covers fundamental patterns including testable code design with io.Writer interfaces, managing default behaviors through nil arguments and global variables versus structs, implementing optional parameters with variadic functions, and handling command-line arguments and flags using the standard library. Demonstrates progressive refactoring from simple hello world examples to a functional line-counting utility.
Table of contents
Making it testableDecreasing complexityOptional parameterCommand-line argumentsCommand-line flagsSort: