But the fifth line however gives me errors, that I don't understand.
The output from the above command is as follows :-
:~/GitHubProjects/rclone$ go build
rclone.go:7:2: cannot find package "github.com/rclone/rclone/backend/all" in any of:
/home/USER/go/src/github.com/rclone/rclone/backend/all (from $GOROOT)
/home/USER/GoProjects/src/github.com/rclone/rclone/backend/all (from $GOPATH)
rclone.go:8:2: cannot find package "github.com/rclone/rclone/cmd" in any of:
/home/USER/go/src/github.com/rclone/rclone/cmd (from $GOROOT)
/home/USER/GoProjects/src/github.com/rclone/rclone/cmd (from $GOPATH)
rclone.go:9:2: cannot find package "github.com/rclone/rclone/cmd/all" in any of:
/home/USER/go/src/github.com/rclone/rclone/cmd/all (from $GOROOT)
/home/USER/GoProjects/src/github.com/rclone/rclone/cmd/all (from $GOPATH)
rclone.go:10:2: cannot find package "github.com/rclone/rclone/lib/plugin" in any of:
/home/USER/go/src/github.com/rclone/rclone/lib/plugin (from $GOROOT)
/home/USER/GoProjects/src/github.com/rclone/rclone/lib/plugin (from $GOPATH)
imports runtime: cannot find package "runtime" in any of:
/home/USER/go/src/runtime (from $GOROOT)
/home/USER/GoProjects/src/runtime (from $GOPATH)
I've installed Go and also configured $GOROOT and $GOPATH. I'm confused as to why it's looking in those directories, even when I change $GOROOT and $GOPATH I still get similar errors as it can't find the packages such as time for example.
If I type the command go version I get the following output: -
go version go1.7.4 linux/amd64
So it must be installed, this is a problem as I am unable to test any code I have written for rclone.
Yes indeed it does, thank you, such a strange error message for an incompatible version, I'd of expected something more meaningful that said what the actual issue was. But I guess the error message is from Go and not rclone.
Go underwent a big change to do with modules and how they are handled. Rclone uses the module system and if you use a version of go which doesn't understand the module system then it will give an error on every module rclone tries to use.
I use Visual Studio Code and really like the integrated support for syntax, cross-referencing, debugging, git and GitHub support. It does have a learning curve too, but once passed you can quickly move between different projects and programming languages. It is free and cross-platform (incl. linux/amd64).