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

bug: cannot use target.Endpoint as string value in struct literal #15286

Closed
chirichan opened this issue Feb 11, 2023 · 9 comments
Closed

bug: cannot use target.Endpoint as string value in struct literal #15286

chirichan opened this issue Feb 11, 2023 · 9 comments

Comments

@chirichan
Copy link

What happened?

v3.5.7

When I build my app, etcd package have an error:

go.etcd.io\etcd\client\[email protected]\naming\resolver\resolver.go:22:11: cannot use target.Endpoint (value of type func() string) as string value in struct literal

What did you expect to happen?

I expect build success.

How can we reproduce it (as minimally and precisely as possible)?

Please see here:

target: target.Endpoint,

it's a simple bug.

Anything else we need to know?

No response

Etcd version (please run commands below)

$ etcd --version
etcd Version: 3.5.0

</details>


### Etcd configuration (command line flags or environment variables)

<details>

</details>


### Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)

<details>

</details>


### Relevant log output

_No response_
@ahrtr
Copy link
Member

ahrtr commented Feb 11, 2023

Have you updated the gRPC version yourself? Please provide the exact steps you did.

This might be related to #15145

@chirichan
Copy link
Author

chirichan commented Feb 12, 2023

Have you updated the gRPC version yourself? Please provide the exact steps you did.

This might be related to #15145

My gRPC version is v1.53.0 ,

this my code:

import (
	clientv3 "go.etcd.io/etcd/client/v3"
	"go.etcd.io/etcd/client/v3/naming/resolver"
)

func Test1(client *clientv3.Client) {
	builder, err := resolver.NewBuilder(client)
	if err != nil {
		return
	}
	_ = builder
}

ectd client version is v3.5.7

it's can't build pass, because ide hint there is an error here

image

@ahrtr
Copy link
Member

ahrtr commented Feb 12, 2023

Note that etcd isn't compatible with gRPC 1.53 for now. We need to resolve #15145 firstly.

FYI. #15131

@chirichan
Copy link
Author

Note that etcd isn't compatible with gRPC 1.53 for now. We need to resolve #15145 firstly.

FYI. #15131

ok

@thisman666
Copy link

Hello, I also met the same problem, may I ask how to solve the final, thank you!

@chirichan
Copy link
Author

Hello, I also met the same problem, may I ask how to solve the final, thank you!

I downgraded the version of grpc to v1.52.3

image

lc-1010 added a commit to lc-1010/OneBlogService that referenced this issue Jul 22, 2023
- etcd and gprc isn't compatible See:etcd-io/etcd#15286 (comment)

#16
@eric49861
Copy link

I change the source code of file resolver.go into target.Endpoint(), because target.Endpoint is a func, but need a string

@Zhuangpx
Copy link

I change the source code of file resolver.go into target.Endpoint(), because target.Endpoint is a func, but need a string

Thank you very much. I tried this too. It's really feasible

@zhenghsh
Copy link

image

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

No branches or pull requests

6 participants