mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
fix(discov): move etcd hosts from URI authority to path for Go 1.26 compatibility (#5548)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user