Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building project with redis lib : duplicate method private #1715

Closed
avikagg opened this issue Apr 5, 2021 · 7 comments
Closed

Error building project with redis lib : duplicate method private #1715

avikagg opened this issue Apr 5, 2021 · 7 comments

Comments

@avikagg
Copy link

avikagg commented Apr 5, 2021

Issue tracker is used for reporting bugs and discussing new features. Please use
stackoverflow for supporting issues.

Trying to build sample project with redis library included.
Error:

# go.opentelemetry.io/otel/trace
../go.opentelemetry.io/otel/trace/config.go:117:2: duplicate method private

Code:

var client = redis.NewClient(&redis.Options{
        Addr:     "host:6379",
        Password: "",
        DB:       0,
})

err := client.Set(ctx, "name", redisValue, 0).Err()

Expected Behavior

Should build the executable file.

Current Behavior

Facing Error

# go.opentelemetry.io/otel/trace
../go.opentelemetry.io/otel/trace/config.go:117:2: duplicate method private

What could be wrong here?

@vmihailenco
Copy link
Collaborator

Should be variation of #1534

@avikagg
Copy link
Author

avikagg commented Apr 5, 2021

hi @vmihailenco thanks for your response.
Actually, I am able to build the package if I exclude redis functionality from the project, only when I include redis functionality it fails with the above error.

@corlinp
Copy link

corlinp commented Apr 15, 2021

Any solution to this @avikagg ? I'm having the same problem, but it was only introduced after I vendored opentelemetry after successfully using the redis package

@corlinp
Copy link

corlinp commented Apr 15, 2021

Turns out the opentelemetry library is not compatible with Go 1.13 or earlier. You are probably trying to build on an older Go version. https://golang.org/doc/go1.14#language

monkey92t added a commit to monkey92t/redis that referenced this issue Apr 22, 2021
redis#1715 (comment)

Signed-off-by: monkey <golang@88.com>
vmihailenco pushed a commit that referenced this issue Apr 27, 2021
* support resp3 protocol

Signed-off-by: monkey <golang@88.com>

* Upgrade mod version limit go1.14

#1715 (comment)

Signed-off-by: monkey <golang@88.com>

* Remove the redundant check of ReadReply

Signed-off-by: monkey <golang@88.com>

* fix the problem

Signed-off-by: monkey <golang@88.com>

* workflows add v9

Signed-off-by: monkey <golang@88.com>

* update StringStringMapCmd to MapStringStringCmd

Signed-off-by: monkey <golang@88.com>
@ravikanthdba
Copy link

ravikanthdba commented May 9, 2021

I had this issue with go version 1.13.

I installed the following go version 1.16, modified my go.mod file to the following:

`module github.com/example

go 1.16

require (
github.com/go-redis/redis/v8 v8.8.1
github.com/gomodule/redigo v1.8.3
github.com/nitishm/go-rejson/v4 v4.0.0
)
`

my code is attached:

This worked and the output is below:
`
rgarimel-mn3:example rgarimel$ go run main.go
Executing Example_JSONSET for Redigo Client
Success: OK
Student read from redis : main.Student{Name:main.Name{First:"Mark", Middle:"S", Last:"Pronto"}, Rank:1}

Executing Example_JSONSET for Redigo Client
Success: OK
Student read from redis : main.Student{Name:main.Name{First:"Mark", Middle:"S", Last:"Pronto"}, Rank:1}
rgarimel-mn3:example rgarimel$
`

I this is needs to be explicitly mentioned
example.zip

@SUN-XIN
Copy link

SUN-XIN commented May 19, 2021

I got the same problem today. The I solved it by updating the version de the lib /go-redis.
I use also go1.13, you can use the version v8.6.0 of this lib if you don't want to update to go1.14
And update your go.mod like github.com/go-redis/redis/v8 v8.6.0

@vmihailenco
Copy link
Collaborator

Seems to be fixed - closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants