title: Go, go get, go install, local packages, and version control
body: <p>I am having trouble understanding the workflow for creating a go project that has local packages.</p>
  
  <p>Say I create a new project, using git for version control, which has a main.go file and a tools.go file which will be in package utils. So I have a directory structure such as this:</p>
  
  <pre><code>/myproject/
     main.go
     utils/
       tools.go
  </code></pre>
  
  <p>main.go looks like this:</p>
  
  <pre><code>package main
  import "./utils"
  func main() {
      utils.DoSomthing()
  }
  </code></pre>
  
  <p>and tools.go looks like this:</p>
  
  <pre><code>package utils;
  func DoSomething() {
  }
  </code></pre>
  
  <p>Everything works just fine locally, using <em>go build</em> and <em>go run</em>. But this is being hosted on github, and I'd like to be able to have others use the <em>go get</em> command to install it. So the local package import must be changed to use the format "github.com/user/project/utils", which works, except now I have two copies of the source code, and the real problem is that the copy with the git history has an import that makes use of the downloaded copy. So if I'm working on the copy with the git history, any changes made to tools.go will go unnoticed, because it will be using the downloaded copy.</p>
  
  <p>So I'm wondering if someone can explain the right way of using <em>go get</em>, version control, and package imports within the same project.</p>