title: How to share variables across packages in go-lang
body: <p>I have written a simple go application and formatted it in to several packages.</p>
  
  <pre><code>+main
  +controllers
  +handlers
  +commons
  +utils
  </code></pre>
  
  <p>I'm starting the server in main package and reading server specific parameters at the startup.</p>
  
  <p>I won't to use those parameters, such as DB properties from commons package. I cannot import main package in to commons 'cause commons is a dependency to controllers, handlers which is a dependency to main. So this causes cyclic import.</p>
  
  <p>How should we handle this kind of situation?. Is it possible to read the configuration once and refer to it inside commons package whenever needed? Example would be helpful.</p>