title: Use mongodb connection from other function
body: <p>I want to use mongodb connection from another function in Go example</p>
  
  <pre><code>func Conn() {
      client, err :=
          mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
  }
  </code></pre>
  
  <p>call that function.</p>
  
  <pre><code>func main(){
      Conn.client//something like this
  }
  </code></pre>