fix(discov): move etcd hosts from URI authority to path for Go 1.26 compatibility (#5548)

This commit is contained in:
Kevin Wan
2026-04-25 10:48:28 +08:00
committed by GitHub
parent 22bdae0787
commit 4a67261b7b
6 changed files with 120 additions and 6 deletions

View File

@@ -13,5 +13,10 @@ func TestBuildDirectTarget(t *testing.T) {
func TestBuildDiscovTarget(t *testing.T) {
target := BuildDiscovTarget([]string{"localhost:123", "localhost:456"}, "foo")
assert.Equal(t, "etcd://localhost:123,localhost:456/foo", target)
assert.Equal(t, "etcd:///localhost:123,localhost:456?key=foo", target)
}
func TestBuildDiscovTargetWithSlashKey(t *testing.T) {
target := BuildDiscovTarget([]string{"localhost:2379"}, "/grpc/my-service")
assert.Equal(t, "etcd:///localhost:2379?key=%2Fgrpc%2Fmy-service", target)
}