AI Snips
Chapters
Transcript
Episode notes
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.
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.
CMD and PKG Folders
- Use
cmd
folders for separate binaries in your Go projects. - Avoid
pkg
folders; your folder structure defines packages.