Section 19
Project Layout
comms engine — standard Go project layout
go.mod — module system
☕ Java — pom.xml / build.gradle
◎ Go — go.mod
Java tool ↔ Go tool mapping
☕ Jackson ObjectMapper / Gson
◎ encoding/json by default; easyjson for hot-path JSON
☕ Hibernate / JPA (ORM)
◎ GORM (closest ORM analog)
☕ SQL-first style (jOOQ mindset)
◎ sqlc (write SQL, generate typed Go methods)
When easyjson is worth it
Start with
encoding/json. Move to easyjson only when profiling proves JSON marshalling is a bottleneck and the model shape is stable enough to justify generated code maintenance.easyjson — generated JSON marshalling
easyjson — 3-5x faster than encoding/json
When sqlc is better than ORM
Choose
sqlc when queries are complex, performance is critical, or you want exact SQL control. sqlc is SQL-first: it generates Go code from SQL files and schema, not from struct tags.sqlc — type-safe SQL without ORM
☕ Java — JPA / Hibernate ORM
◎ Go — sqlc (write SQL, get Go)