安装gorp(GO)遇到了问题。

huangapple go评论83阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2014年5月21日 10:52:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/23773198.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定