douli6605 2016-06-02 22:41 采纳率: 100%
浏览 42

BoltDB离线构建

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)
...
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向