title: Calling a variable from another function in go
body: <p>I know that variables are pass by value in go. However, I want to call a variable that in inside a func outside this function. Let me give you an example:</p>
  
  <pre><code>package main
  
  import (
  
      "fmt"
  )
  
  func Smile(){
    A := 5
  }
  
  func main() {
  
     fmt.Println(A)
  
  }
  </code></pre>
  
  <p>This gives me undefine A. </p>
  
  <p>what is the best way to pass A ? Should I use a pointer? How do I do that?</p>