David Symonds
unread,Aug 15, 2015, 6:40:02 PM8/15/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Yann Salaün, golang-nuts
Blank imports are usually only used for their side effects (otherwise
you'd be using the package by name). Since the side effects generally
affect the whole program (e.g. registering an SQL driver), they should
be done as high as possible in the dependency tree (generally package
main) so that it doesn't preclude the lower packages from being
re-used with a different side effect package. In your case, your
models package might likely be usable in other situations (e.g. with a
different driver, or just for tests) and so it shouldn't force a
dependency on a specific driver.