liveBook · Manning

Configuration

As explained in Shipping Go: Develop, deliver, discuss, design, and go again

Settings or input values that control an application's behavior independently of its source code.

Configuration supplies input that changes an application's behavior without changing or recompiling its source code. This keeps one implementation adaptable across experiments, environments, and delivery stages. section 1.3.7 section 8.1

Changing a counter without recompiling

A counter can read an INC environment variable at startup. Running `INC=2 go run counter.go` makes it increment by two; invalid input falls back to one. The same pattern suits database connections, password salts, client endpoints, and log levels. section 8.1

A practical configuration loader layers values so operators can start with safe defaults and override them deliberately:

Loaded settings can select implementation paths as well as values. For example, a configured client URL switches an API from a static translation service to a remote client, allowing QA and development to proceed in parallel. section 8.3.2

How Shipping Go: Develop, deliver, discuss, design, and go again covers it

How deep it goes
Demonstrates environment variables, JSON files, defaults, flags, precedence, and dependency selection, but defers persistent storage.
Examples
Uses a configurable counter, port overrides, JSON configuration, environment variables, command-line flags, and selectable translation clients.
What it assumes
Assumes application development familiarity and connects configuration-driven selection to dependency injection and interfaces.
What you can do after
Operate/configure Go applications through defaults, files, environment variables, and flags, then select service implementations from loaded settings.
How it connects
Connects configuration with environment variables, dependency injection, feature flags, semantic versioning, and continuous deployment.

Also explained in

Compare how 23 books explain configuration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Shipping Go: Develop, deliver, discuss, design, and go again. The section links point to the parts of the book it draws on.