Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One quick suggestion on project structure:

Move all the structs from models/ into the root directory.

This allow users of this package to have nice and short names like: q.Message and q.Queue, and avoids import naming conflicts if the user has its own „models“ package.



Thanks for the tip - and for even looking at the code! I always struggle to figure out how to organize things.


Just noticed that your root directory is already „package main“ so you can either move that to /cmd/something/ or simply rename models/ to q/. That would have the same effect and is also idiomatic.


Actually, the "model/" (note: singular form) directory (package model) would be preferred in the golang world.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: