Coupling describes how directly one component depends on another. Loose coupling replaces concrete implementations with focused abstractions, allowing implementations to change without changing dependent code. section 2.5.2
Interfaces reduce coupling when they express the dependency a component actually needs:
- Depend on common behavior rather than a concrete type, as sort.Interface does for collection sorting. section 2.5.2
Error wrapping can create coupling
Returning fmt.Errorf("bar failed: %w", err) preserves the source error for callers, so callers may couple themselves to its type. If that source error is an implementation detail, fmt.Errorf("bar failed: %v", err) adds context while transforming it and making unwrapping unavailable. section 7.2
















