trouble installing gorp (GO)

148 views Asked by At

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.

2

There are 2 answers

3
VonC On BEST ANSWER

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)
0
Pierre Prinetti On

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.