redismock icon indicating copy to clipboard operation
redismock copied to clipboard

go get install errors

Open fhquthpdw opened this issue 5 years ago • 2 comments

Hi, When I install it by comamnd: go get github.com/elliotchance/redismock

show me an error list then can not install successful ../github.com/elliotchance/redismock/cmdable.go:135:26: cannot use db (type int64) as type int in argument to m.client.client.cmdable.Migrate ../github.com/elliotchance/redismock/cmdable.go:143:23: cannot use db (type int64) as type int in argument to m.client.client.cmdable.Move ../github.com/elliotchance/redismock/z_cmd.go:51:23: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAdd ../github.com/elliotchance/redismock/z_cmd.go:59:25: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAddNX ../github.com/elliotchance/redismock/z_cmd.go:67:25: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAddXX ../github.com/elliotchance/redismock/z_cmd.go:75:25: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAddCh ../github.com/elliotchance/redismock/z_cmd.go:83:27: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAddNXCh ../github.com/elliotchance/redismock/z_cmd.go:91:27: cannot use members (type []redis.Z) as type []*redis.Z in argument to m.client.client.cmdable.ZAddXXCh ../github.com/elliotchance/redismock/z_cmd.go:99:24: cannot use member (type redis.Z) as type *redis.Z in argument to m.client.client.cmdable.ZIncr ../github.com/elliotchance/redismock/z_cmd.go:107:26: cannot use member (type redis.Z) as type *redis.Z in argument to m.client.client.cmdable.ZIncrNX ../github.com/elliotchance/redismock/z_cmd.go:107:26: too many errors

fhquthpdw avatar Jul 31 '19 05:07 fhquthpdw

I have not updated the repo to use go modules yet. I suspect those errors are because of the github.com/go-redis/redis version you have installed. Try installing the specific version with dep first:

dep ensure github.com/go-redis/[email protected]
go get -u go get github.com/elliotchance/redismock

elliotchance avatar Jul 31 '19 07:07 elliotchance

I followed the advice in the answer and this is working ok for me

hom-bahrani avatar Sep 25 '19 10:09 hom-bahrani