title: Call a function from another package in Go
body: <p>I have two files <code>main.go</code> which is under <code>package main</code>, and another file with some functions in the package called functions.</p>
  
  <p>My question is: How can I call a function from <code>package main</code>?</p>
  
  <p><strong>File 1: main.go (located in MyProj/main.go)</strong></p>
  
  <pre><code>package main
  
  import "fmt"
  import "functions" // I dont have problem creating the reference here
  
  func main(){
      c:= functions.getValue() // &lt;---- this is I want to do
  }
  </code></pre>
  
  <p><strong>File 2: functions.go (located in MyProj/functions/functions.go)</strong></p>
  
  <pre><code>package functions
  
  func getValue() string{
      return "Hello from this another package"
  }
  </code></pre>