运行输出花费的时间太长

If I click on "Run go build index.go", Goland takes 3 seconds until it returns the output. Each other time it takes about 20 seconds. It is not about the code, because the code is simple:

package main

import "fmt"

func main() {
    fmt.Println("Hello World")
}

If I run this file on terminal with go run index.go, it takes about 1 second.

I have just installed Goland for the first time, so there are no older configs in it. How can I fix this issue?

First, make sure you have the latest Go version, Go 1.10.2 at the time of writing. This improves the compilation speed dramatically due to caches added by the Go tool.

Second, since this doesn't seem to be a constant issue, do you actually have this problem only on running that specific program with no debugging session in between? Is your anti-virus/computer doing something else in background?