How do I configure goland to recognize 'mod' packages? : <p>I am taking go1.11rc1 for a spin and the first thing I noticed is that goland does not recognize imports. </p>

<p>The <a href="https://blog.jetbrains.com/go/2018/07/25/goland-2018-2/" rel="noreferrer">goland version announcement</a> says: "support for Go modules out of the box (formerly known as vgo)"</p>

<p>Anyone know how to fix this?</p>

<p>Problem: </p>

<ol>
<li>Packages like "github.com/urfave/cli" colored red and hover text says: "Cannot resolve directory..."</li>
<li>Imported package items like "NewApp" in "app := cli.NewApp()" colored red and hover text says: "Unresolved reference ..."</li>
</ol>

<p>Steps to reproduce:</p>

<ol>
<li>Install go1.11rc1: remove the current install, install 1.11rc1, check version.</li>
<li>Create a new project directory outside the go path: <code>mkdir pjg &amp;&amp; cd pjg</code></li>
<li>Create a <code>go.mod</code> file: <code>go mod init github.com/stevetarver/pjg</code></li>
<li>Add a package to the project: <code>go get github.com/urfave/cli</code></li>
</ol>

<p><code>go.mod</code> file now looks like:</p>

<pre><code>module github.com/stevetarver/pjg/v1

require github.com/urfave/cli v1.20.0 // indirect
</code></pre>

<p>Create <code>main.go</code>:</p>

<pre><code>package main

import (
    "fmt"
    "log"
    "os"

    "github.com/urfave/cli"
)

func main() {
    app := cli.NewApp()
    app.Name = "boom"
    app.Usage = "make an explosive entrance"
    app.Action = func(c *cli.Context) error {
        fmt.Println("boom! I say!")
        return nil
    }

    err := app.Run(os.Args)
    if err != nil {
        log.Fatal(err)
    }
}
</code></pre>

<p>View <code>main.go</code> in goland, and hover over red text to see problem.</p>

<ul>
<li>mod packages are stored in <code>$GOPATH/pkg/mod/</code></li>
<li>goland version: 2018.2.1</li>
<li>go version: go1.11rc1 darwin/amd64</li>
</ul>

<p>Notes:</p>

<ul>
<li><code>$GOPATH</code> is set correctly - <code>go get</code> put the package in the right place, GOPATH in env matches goland preferences.</li>
<li>Setting goland preferences Go -> GOPATH -> Module GOPATH to <code>/Users/starver/code/go/pkg/mod</code> did not fix this.</li>
</ul>
