Go, from zero to a running service · Chapter 3 of 12 · Languages · new chapter every Tuesday night
By the end of this chapter: Model data in a language that deliberately has no classes.
The problem
Emma is a junior backend engineer on a fintech startup that just landed its first B2B client. The client wants a new “transaction‑validation” service that will sit behind the existing Java monolith. The product manager has pushed the deadline to two weeks because the client’s contract starts next month.
Emma, eager to prove herself, decides to write the service in Go because the team’s senior engineer swore it would “just work faster”. She clones a starter repository, adds a single http.Handler that parses JSON, validates a few fields and returns a 200 OK. She runs the binary locally and everything looks fine.
However, as she starts to add more validation rules and error handling, her code becomes increasingly complex and hard to manage.…