title: Accessing variables across packages in Go
body: <p>I have two variables in the scope of <code>package main</code>, those would be these:</p>
  
  <pre><code>var (
      app Application
      cfg Config
  )
  </code></pre>
  
  <p>Now, since the size of my application is starting to increase, I have decided to put each module of the website in its own package, much like a subdirectory as so:</p>
  
  <pre><code>/src/github.com/Adel92/Sophie
    + user/   (package user)
       - register.go
       - login.go
       - password.go
    + topic/  (package topic)
       - ... etc
    - main.go (package main)
  </code></pre>
  
  <p>How would I go around around accessing the <code>app</code> and <code>cfg</code> global variables from other packages? Is this the wrong way to go about it? I have a feeling it is.</p>
  
  <p>In that case, how would I declare functions in their own namespace so I don't have to go crazy with names that are affixed with <code>user</code> and <code>topic</code> all the time.</p>