title: Function in same package undefined
body: <p>My project structure is like this.</p>
  
  <pre><code>packagetest/
      main.go
      lib.go
  </code></pre>
  
  <p>In <code>main.go</code>, I have this code.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Println("Hello from main.go.")
      Test()
  }
  </code></pre>
  
  <p>While in <code>lib.go</code>, I have this code.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func Test() {
      fmt.Println("This is the Test function in lib.go.")
  }
  </code></pre>
  
  <p>When I try to compile with <code>go build main.go</code>, I get <code>./main.go:7: undefined: Test</code>. Is this way of structuring my code possible?</p>