title: Go unit test not finding required file
body: <p>I have written a unit test in go and the init method of that same file opens a file in the root of the project. The problem that I am having is that when I run the test the package of the test is the root directory which does not contain the required file. How can I tell the test function to see the file without creating a duplicate file in the directory of the test file?</p>
  
  <p>File structure:</p>
  
  <pre><code>main.go
  |+-helpers
     |+-data.go
     |+-data_test.go
  required_file.txt
  </code></pre>
  
  <p>Test command:</p>
  
  <pre><code>go test github.com/testproj/helpers
  </code></pre>
  
  <p>Code in data.go:</p>
  
  <pre><code>func init() {
      file, err := os.Open("required_file.txt") 
        if err != nil {
          log.Fatal(err) &lt;-- required_file.txt not found
        }
  }
  </code></pre>