RediSearch / redisearch-go

Go client for RediSearch

Home Page:https://redisearch.io

Repository from Github https://github.comRediSearch/redisearch-goRepository from Github https://github.comRediSearch/redisearch-go

How to use v2.0.2 version in project

mixadior opened this issue · comments

Hi, all

i try to add

bash-3.2$ ./go.sh get -d github.com/RediSearch/redisearch-go@v2.0.2 go get: github.com/RediSearch/redisearch-go@v2.0.2: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2 bash-3.2$

but it failed with error.

@mixadior you're totally right and we've still not added an /v2 folder that is required due to the major version bump.
However, and to be able to use right-away all features you use the v2.0.2 commit within go get, as follows:

$ go mod init test/test
go: creating new go.mod: module test/test
$ GO111MODULE=on go get -v -d github.com/RediSearch/redisearch-go@4f1c7d992619a6ff048d84ba850fa6de28a7b72a
go: finding github.com/RediSearch 4f1c7d992619a6ff048d84ba850fa6de28a7b72a
go: finding github.com/RediSearch/redisearch-go 4f1c7d992619a6ff048d84ba850fa6de28a7b72a
go: finding github.com 4f1c7d992619a6ff048d84ba850fa6de28a7b72a

I've tested with this simple example that uses an v2.0.2 added function:

package main

import (
	"github.com/RediSearch/redisearch-go/redisearch"
)

func main(){
	c := redisearch.NewClient("localhost:6379", "myIndex")
	c.DropIndex(true)
}

Let's keep this issue open until we fix this issue and release v2.0.3 with the proper folder struct. Thank you for reporting it!

Hi, thx for fast response.
One more question - why do you use redigo v2.0.0, which is not adopted to gomodules?

https://github.com/RediSearch/redisearch-go/blob/master/go.mod :


go 1.12

require (
	github.com/gomodule/redigo v2.0.0+incompatible
	github.com/stretchr/testify v1.6.1
)

latest release is 1.8.3 , i'm not so fluent in go modules, but seems redigo v2.0.0 is left from migration and is orphaned - gomodule/redigo#366

Hi, thx for fast response.
One more question - why do you use redigo v2.0.0, which is not adopted to gomodules?

https://github.com/RediSearch/redisearch-go/blob/master/go.mod :


go 1.12

require (
	github.com/gomodule/redigo v2.0.0+incompatible
	github.com/stretchr/testify v1.6.1
)

latest release is 1.8.3 , i'm not so fluent in go modules, but seems redigo v2.0.0 is left from migration and is orphaned - gomodule/redigo#366

@mixadior It seems that when we enabled go modules, for some reason that was the version that I was working with on a48d16f . One very interesting thing is that we kicked off go mod support pretty much at the same time across other redislabs projects ( example of redistimeseries-go https://github.com/RedisTimeSeries/redistimeseries-go/blob/master/go.mod ) and it seems that for some reason I did a bad version update on this one... ( on timeseries is as expected )
I'll discuss internally our versioning issue but I believe we should revert using v2 to when we add a new large feature(breaking one) that will probably be OSS cluster support (#34 ), and keep with the minor/patch release updates until then.

@filipecosta90 interesting )), redigo 2.0.0 has last commit in 2018. Probably it will be better to change go.mod file to redigo v1.8.3 , because redisearch is compatible with v1.x.x of redigo and everything should work ok. Anyway, thx.

Hi there @mixadior, we've just released v1.1.0 that should have all fixes we've discussed. Once again thank you for raising this issue :)