The Secret Life of Go: Hidden Dependencies in Context
The Secret Life of Go: Hidden Dependencies in Context Context values, dependency injection, and the testing nightmare #Go #Coding #SoftwareArchitecture #BackendDev Eleanor is a senior software engineer. Ethan is her junior colleague. They work in a beautiful beaux arts library in Lower Manhattan — the kind of place where coding languages are discussed like poetry. Episode 36 Ethan was cleaning up the function signatures in the billing service. He had just discovered a feature in Go's standard library that he felt was going to change his life. "I solved the dependency problem," Ethan announced as Eleanor passed by his desk. "I had all these functions that needed the database connection, the logger, and the current user ID. The function signatures were getting ridiculously long. But then I found context.WithValue ." He showed her his updated code: // Ethan's refactored handler func HandlePayment (ctx context.Context, amount float64) error { // Ex...