I’m trying to get a basic build environment up and running so I can break some of fd0’s excellent work… sadly, I’m 100% new to writing anything in go and don’t know much about how the import/dependency infra is supposed to work. I tried following the build instructions here as described, but ran into the following error:
lwobker@lwobker-vms:~/go/src/github.com/restic/restic$ go build ./cmd/restic
cmd/restic/cmd_diff.go:4:2: cannot find package "context" in any of:
/home/lwobker/go/src/github.com/restic/restic/vendor/context (vendor tree)
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/lwobker/go/src/context (from $GOPATH)
The full output is pasted below for reference. It’s obviously some type of error in where the context package lives, and I’m pretty sure that I could make it work (or at least peel the onion one more layer) by manually moving around where the go packages live, but I also think that the point of the build/contributing.md instructions is to have something that should “just work” for everyone, so I figured I’d bring it up and see if there’s something that could/should be fixed in the tree.
I’m working from this commit in master on Jan 7 2018…
lwobker@lwobker-vms:~$ env | grep GO
GOPATH=/home/lwobker/go
lwobker@lwobker-vms:~$ mkdir -p "$GOPATH/src/github.com/restic"
lwobker@lwobker-vms:~$ cd "$GOPATH/src/github.com/restic"
lwobker@lwobker-vms:~/go/src/github.com/restic$ git clone https://github.com/restic/restic
Cloning into 'restic'...
remote: Counting objects: 33722, done.
remote: Compressing objects: 100% (83/83), done.
remote: Total 33722 (delta 67), reused 112 (delta 59), pack-reused 33577
Receiving objects: 100% (33722/33722), 37.08 MiB | 23.13 MiB/s, done.
Resolving deltas: 100% (20301/20301), done.
Checking connectivity... done.
rest lwobker@lwobker-vms:~/go/src/github.com/restic$ cd restic/
lwobker@lwobker-vms:~/go/src/github.com/restic/restic$ go build ./cmd/restic
cmd/restic/cmd_diff.go:4:2: cannot find package "context" in any of:
/home/lwobker/go/src/github.com/restic/restic/vendor/context (vendor tree)
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/lwobker/go/src/context (from $GOPATH)
lwobker@lwobker-vms:~/go/src/github.com/restic/restic$