goubuntu-12.04gorp

trouble installing gorp (GO)


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.


Solution

  • 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)