title: golang can not find package gin in sub directory
body: <p>I get the following error message:</p>
  <pre><code>controllers/user.go:4:2: cannot find package &quot;(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin&quot; 
  in any of: /usr/local/go/src/(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin (from $GOROOT) 
       /home/ubuntu/goapi/src/_(underscore)/home/ubuntu/goapi/src/github.com/roes/api/vendor/github.com/gin-gonic/gin (from $GOPATH)
  </code></pre>
  <p>go env</p>
  <pre><code>GOPATH=&quot;/home/ubuntu/goapi&quot;
  GOROOT=&quot;/usr/local/go&quot;
  </code></pre>
  <p>folder structure</p>
  <pre><code>github.com/rose
   api
    main.go // the loading gin is ok here
    controller
     |-user.go //with import ( &quot;github.com/gin-gonic/gin&quot; ) : error
  </code></pre>
  <p>go env looks Ok.</p>
  <p>Some more code:</p>
  <pre><code>  package controller
  
    import (
      &quot;github.com/gin-gonic/gin&quot;
      &quot;net/http&quot;
      //      &quot;github.com/astaxie/beego/orm&quot;
      &quot;../database&quot;
      &quot;../models&quot;
    )
  
    func init() {
      database.ConnectToDb()
      ORM = database.GetOrmObject()
    }
  
     //UserController ...
     type UserController struct{}
  
     func createUser(c *gin.Context) {
  </code></pre>
  <p>example resource: <a href="https://github.com/thearavind/go-gin-pg" rel="nofollow noreferrer">https://github.com/thearavind/go-gin-pg</a>, nothing wrong with this example. I just make it like MVC structure</p>
  <hr />
  <p>I did remove go.
  and install it again flow Linux version
  <a href="https://golang.org/doc/install" rel="nofollow noreferrer">https://golang.org/doc/install</a>
  then</p>
  <pre><code>export GOPATH=$HOME/go
  export PATH=$PATH:$GOPATH/bin
  </code></pre>
  <p>then
  <a href="https://github.com/gin-gonic/gin#use-a-vendor-tool-like-govendor" rel="nofollow noreferrer">https://github.com/gin-gonic/gin#use-a-vendor-tool-like-govendor</a>
  the example code run ok.
  when I add controller folder with user.go with</p>
  <pre><code> import( &quot;github.com/gin-gonic/gin&quot;)
  </code></pre>
  <p>full code</p>
  <pre><code>  package controller
    import( &quot;github.com/gin-gonic/gin&quot;)
    func somestring(){
      return &quot;hello world&quot;
    }
  </code></pre>
  <p>in the main.go i use above</p>
  <pre><code>   curl https://raw.githubusercontent.com/gin-gonic/gin/master/examples/basic/main.go &gt; main.go
      
  </code></pre>
  <p>add to import</p>
  <pre><code>    &quot;./controller&quot;
      &quot;fmt&quot;
  </code></pre>
  <p>add to the main function</p>
  <pre><code>        user := new(controller.somestring)
          fmt.Printf(user)
  </code></pre>
  <p>I understand this is not a good code for me, but will produce this error again, like so:</p>
  <pre><code> controller/user.go:4:2: cannot find package &quot;github.com/gin-gonic/gin&quot; in any of:
  /usr/local/go/src/github.com/gin-gonic/gin (from $GOROOT)
  /home/ubuntu/go/src/github.com/gin-gonic/gin (from $GOPATH)
  </code></pre>
  <p>(no underscore this time)</p>
  <p>No luck, reinstall go</p>
  <hr />
  <p>I am able to find the path, but not the underscore thing</p>
  <pre><code> 08:56:35 ~/go/src/github.com/jerry/core$ cd /home/ubuntu/go/src/github.com/jerry/core/vendor/github.com/gin-gonic/
   08:56:45 ~/go/src/github.com/jerry/core/vendor/github.com/gin-gonic$
  </code></pre>