No such file or directory Compilation finished with exit code 126

I get the following error when I run "go build helloworld.go

 

GOROOT=/home/bavramor/go/go1.14.2 #gosetup
GOPATH=/home/bavramor/data/Webdesign/Webseiten/go #gosetup

Cannot run program "/home/bavramor/go/go1.14.2/bin/go" (in directory "/home/bavramor/go/src/gofullstack"): error=2, No such file or directory

Compilation finished with exit code 126

Why is that? The bash makes it work.

Thx and Greetz

Bavra

0
4 comments

Hi, what is the package of the `helloworld.go` file?

It should be `package main`. If it's not, then change it to that.

0

Thx very much,

It's only a Test, but this is my code:

 

package main

import "fmt"

func main() {
fmt.Println("TestWorld")
}
0

goland 2019.3.3

0

My "gopath" was misplaced, but didn't change anything.

GOROOT=/home/bavramor/go/go1.14.2 #gosetup
GOPATH=/home/bavramor/go #gosetup

Cannot run program "/home/bavramor/go/go1.14.2/bin/go" (in directory "/home/bavramor/go/src/gofullstack"): error=2, No such file or directory
Compilation finished with exit code 126

0

Please sign in to leave a comment.