0

So I have some work I need to do behind a corporate firewall and I am new to building Go Apps. The only go app I have worked with has already been built and ready to use. I wanted to play with BoltDB but the problem is that I can't install it because it requires:

go get github.com/boltdb/bolt/...

Because my server cannot go out to github.com it cannot pull this. I don't quite understand the go build strategy and if it is possible to do the go get on my local machine and do that command and copy the $GOPATH contents to the server. That has been giving me an error.

I've also tried to load the repo on an internal git but it requires what looks like calls to other dependencies? Does anyone know how I would be able to deploy BoltDB on my server without the go get command?

Edit: What I've tried so far on my local laptop is set my go path:

export GOPATH=/Users/abc/go
go get github.com/boltdb/bolt/...
ls -ltr go/

(which shows files), zipped up the go directory. Went to my server and set my GOPATH,

export GOPATH=/opt/space/gopath
cd /opt/space/gopath
wget https://.../general/go.zip
unzip go.zip
mv go/* .

The same file structure now appears that I have on my local laptop as is on my server. When I run cayley (the app I am playing around with):

./cayley http --host="10.xxx.xx.xxx" --db="bolt" --dbpath=/tmp/bolt3

I get all sorts of wonky errors that I can't find anyone else online getting when using bolt.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x8 pc=0x698a03]

goroutine 1 [running]:
github.com/boltdb/bolt.(*Bucket).Get(0x0, 0xc20802b3f8, 0x4, 0x8, 0x0, 0x0, 0x0)
...
theMadKing
  • 2,064
  • 7
  • 32
  • 59
  • Yes, you can copy the contents of GOPATH to the server. Have you tried that? – JimB Jun 02 '16 at 22:49
  • I have put a GOPATH on my server and copied over the contents from my local laptop zipped it and brought it over and expanded. It doesnt seem to work. – theMadKing Jun 02 '16 at 22:52
  • 1
    Then please show what you did. Copying the GOPATH is how you would provide all the dependencies. – JimB Jun 02 '16 at 23:07
  • Added details on what I did to bring over boltDB – theMadKing Jun 02 '16 at 23:14
  • Did you build new binaries, or are you trying to use the ones compiled in your laptop? – JimB Jun 02 '16 at 23:16
  • I've listed out the steps I thought I should do above, how would one rebuild the new binaries? – theMadKing Jun 02 '16 at 23:18
  • The same command you used the first time, or since you have all the dependencies already, just `go install github.com/boltdb/bolt/...` – JimB Jun 02 '16 at 23:39
  • Did that, I am now wondering since the go get and go install both worked with no error or didnt give any message but looks to have worked? That it must be an issue on the cayley side of things. – theMadKing Jun 02 '16 at 23:43

0 Answers0