title: How to have a global variable accessible across all packages
body: <p>I have a main.go file which has:</p>
  
  <pre><code>// running the router in port 9000
  func main() {
      router,Global := routers.InitApp()
      fmt.println(Global)
      router.RunTLS(":9000" , "domain.crt" , "domain.key")
  }
  </code></pre>
  
  <p>In <code>router.InitMap</code> I want to declare a global variable which can be accessed throughout my application anywhere. Is is possible? I tried:</p>
  
  <pre><code>func InitApp() (*gin.Engine,string) {
          var Global= "myvalue"           
          router := gin.New()
          return router,Global
  
  
  }
  </code></pre>
  
  <p>But I can't access the variable <code>Global</code> even in the same package.</p>