I am taking go1.11rc1 for a spin and the first thing I noticed is that goland does not recognize imports.
The goland version announcement says: "support for Go modules out of the box (formerly known as vgo)"
Anyone know how to fix this?
Problem:
- Packages like "github.com/urfave/cli" colored red and hover text says: "Cannot resolve directory..."
- Imported package items like "NewApp" in "app := cli.NewApp()" colored red and hover text says: "Unresolved reference ..."
Steps to reproduce:
mkdir pjg && cd pjggo.modgo mod init github.com/stevetarver/pjggo get github.com/urfave/cli
go.mod
module github.com/stevetarver/pjg/v1
require github.com/urfave/cli v1.20.0 // indirect
main.go
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)
}
}
main.go
$GOPATH/pkg/mod/
Notes:
$GOPATHgo get/Users/starver/code/go/pkg/mod