title: Could not import local modules in Golang
body: <p>I am trying to import local modules, but I am unable to import it using <code>go mod</code>. I initially built my project using <code>go mod int github.com/AP/Ch2-GOMS</code></p>
  
  <p>Note my environment is <code>go1.14</code> and I am using VSCode as my editor. </p>
  
  <p>This is my folder structure</p>
  
  <pre><code>Ch2-GOMS
  │   ├── go.mod
  │   ├── handlers
  │   │   └── hello.go
  │   └── main.go
  </code></pre>
  
  <p>My <code>main.go</code> code:</p>
  
  <pre><code>package main
  
  import (
      "log"
      "net/http"
      "os"
  
      "github.com/AP/Ch2-GOMS/handlers" // This gives "could not import github.com/AP/Ch2-GOMS/handlers" lint error
  )
  
  func main() {
  
      l := log.New(os.Stdout, "product-api", log.LstdFlags)
      hh := handlers.NewHello(l)
  
      sm := http.NewServeMux()
      sm.Handle("/", hh)
  
      http.ListenAndServe(":9090", nil)
  } 
  </code></pre>
  
  <p>I cannot see auto-complete for my local modules such as <code>handlers.NewHello</code>.</p>
  
  <p><code>go build</code> generated <code>go.mod</code> contents:</p>
  
  <pre><code>module github.com/AP/Ch2-GOMS
  go 1.14
  </code></pre>
  
  <p>I am also getting <strong><em>You are neither in a module nor in your GOPATH. Please see <a href="https://github.com/golang/go/wiki/Modules" rel="noreferrer">https://github.com/golang/go/wiki/Modules</a> for information on how to set up your Go project.</em></strong> warning in VScode, even though i have set <code>GO111MODULE=on</code> in my <code>~/.bashrc</code> file</p>