英文:
trouble installing gorp (GO)
问题
嘿,我正在尝试安装gorp库,但是遇到了以下错误:
# github.com/coopernurse/gorp
/usr/lib/go/src/pkg/github.com/coopernurse/gorp/gorp.go:1534:
method arg.FieldByName is not an expression, must be called
是gorp构建出了问题吗?还是我做错了什么?
谢谢任何建议。
英文:
Hey I was trying to install the gorp library,
go get github.com/coopernurse/gorp
but got the following error:
# github.com/coopernurse/gorp
/usr/lib/go/src/pkg/github.com/coopernurse/gorp/gorp.go:1534:
method arg.FieldByName is not an expression, must be called
is the gorp build just broken? Or am I doing something wrong?
Thanks for any advice.
答案1
得分: 1
请确保使用最新的Go版本以成功编译此库。
我刚刚测试了:
> go version go1.2.1 windows/amd64
这样编译是可以的,包括奇怪的第1534行:
case arg.Kind() == reflect.Struct && !(arg.Type().PkgPath() == "time" && arg.Type().Name() == "Time"):
return expandNamedQuery(m, query, arg.FieldByName)
英文:
Make sure to use the latest go in order to compile successfully this library.
I just tested with:
> go version go1.2.1 windows/amd64
And that does compile, including the strange line 1534:
case arg.Kind() == reflect.Struct && !(arg.Type().PkgPath() == "time" && arg.Type().Name() == "Time"):
return expandNamedQuery(m, query, arg.FieldByName)
答案2
得分: 0
该存储库已迁移到github.com/go-gorp/gorp。
请使用go get gopkg.in/gorp.v1
进行安装。相应地使用import
语句。
请注意,正如README所说:
此软件包与Go的最后两个主要版本兼容,目前为1.3和1.4。
英文:
The repository has moved to github.com/go-gorp/gorp.
Please install with go get gopkg.in/gorp.v1
. Use the import
statement accordingly.
Note that, as the README says:
>This package is compatible with the last 2 major versions of Go, at this time 1.3 and 1.4.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论