title: go test can't find function in a same package
body: <p>The directory structure is :</p>
  
  <pre><code>src
  src/pkg
  src/pkg/t1.go
  src/pkg/t1_test.go
  </code></pre>
  
  <hr>
  
  <h3>t1.go</h3>
  
  <pre><code>package pkg
  
  import (
  "fmt"
  )
  
  func SayHI(){
      fmt.Println("this is t1")
  }
  </code></pre>
  
  <hr>
  
  <h3>t1_test.go</h3>
  
  <pre><code>package pkg
  
  import (
      "testing"
  )
  
  func TestXYZ(t *testing.T) {
      SayHI()
  }
  </code></pre>
  
  <hr>
  
  <p>Invoke go test from command line at dir <code>src/pkg</code></p>
  
  <p><code>go test t1_test.go</code></p>
  
  <hr>
  
  <h3>error:</h3>
  
  <pre><code>./t1_test.go:8: undefined: SayHI
  FAIL    command-line-arguments [build failed]
  </code></pre>
  
  <p>but the function is there</p>
  
  <p>thanks for any hints</p>