title: Go not resolving GitHub package imports
body: <p>New to Go/Golang and am trying to understand its package/dependency management system a little better.</p>
  
  <p>I cloned <a href="https://github.com/WPFerg/services" rel="nofollow noreferrer">this simple web service repo</a> off GitHub and tried running it with <code>go run main.go</code>. In that <code>main.go</code> file:</p>
  
  <pre><code>package main
  
  import (
      "log"
      "net/http"
      "strconv"
  
      "github.com/wpferg/services/httpHandlers"
      "github.com/wpferg/services/storage"
      "github.com/wpferg/services/structs"
  )
  
  const PORT = 8080
  
  var messageId = 0
  
  func createMessage(message string, sender string) structs.Message {
      messageId++
      return structs.Message{
          ID:      messageId,
          Sender:  sender,
          Message: message,
      }
  }
  
  func main() {
      log.Println("Creating dummy messages")
  
      storage.Add(createMessage("Testing", "1234"))
      storage.Add(createMessage("Testing Again", "5678"))
      storage.Add(createMessage("Testing A Third Time", "9012"))
  
      log.Println("Attempting to start HTTP Server.")
  
      http.HandleFunc("/", httpHandlers.HandleRequest)
  
      var err = http.ListenAndServe(":"+strconv.Itoa(PORT), nil)
  
      if err != nil {
          log.Panicln("Server failed starting. Error: %s", err)
      }
  }
  </code></pre>
  
  <p>When I run this (<code>run go main.go</code>) I get:</p>
  
  <pre><code>main.go:8:2: cannot find package "github.com/wpferg/services/httpHandlers" in any of:
      /usr/local/go/src/github.com/wpferg/services/httpHandlers (from $GOROOT)
      /Users/myuser/go/src/github.com/wpferg/services/httpHandlers (from $GOPATH)
  main.go:9:2: cannot find package "github.com/wpferg/services/storage" in any of:
      /usr/local/go/src/github.com/wpferg/services/storage (from $GOROOT)
      /Users/myuser/go/src/github.com/wpferg/services/storage (from $GOPATH)
  main.go:10:2: cannot find package "github.com/wpferg/services/structs" in any of:
      /usr/local/go/src/github.com/wpferg/services/structs (from $GOROOT)
      /Users/myuser/go/src/github.com/wpferg/services/structs (from $GOPATH)
  </code></pre>
  
  <p>So it <em>seems</em> Go supports a way of "fetching" other packages from GitHub via HTTP but for some reason when I run it locally, its expecting the packages to be local.</p>
  
  <p>What can I do to fix this so that the other packages are resolved? Why is Go looking for them locally instead of fetching them via the URL?</p>