Go Time: Golang, Software Engineering

The files & folders of Go projects

8 snips
May 31, 2023
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Go Package Structure and Circular Dependencies

  • Go's package structure is influenced by its no-circular-dependencies rule.
  • This affects design choices more than in languages like Ruby or Java.
ADVICE

Structuring Packages to Avoid Circular Dependencies

  • Start with the application domain (core objects) in the root directory.
  • Let other packages reference this root, avoiding direct dependencies.
ADVICE

CMD and PKG Folders

  • Use cmd folders for separate binaries in your Go projects.
  • Avoid pkg folders; your folder structure defines packages.
Get the Snipd Podcast app to discover more snips from this episode
Get the app