Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Domain Primitives in Go: One Type Per Real-World Concept

DEV Community·Gabriel Anhaia·about 1 month ago
#M9HsiQnB
#go#architecture#backend#string#return#func
Reading 0:00
15s threshold

Book: Hexagonal Architecture in Go Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You're reviewing a pull request. The function signature is this: func TransferFunds ( from string , to string , amount float64 , currency string , note string , ) error Enter fullscreen mode Exit fullscreen mode Five arguments. Four of them are strings. The reviewer reads the diff, nods, hits approve. Two weeks later support gets a ticket: a EUR transfer landed in a USD account at the dollar amount of the original request. Somewhere a float64 was treated as cents. Somewhere from and to got swapped because the caller had them in a different order in a struct. None of those bugs needed to be possible.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More