feat: more meaningful error messages, close body on httpc requests (#2238)
* feat: more meaningful error messages, close body on httpc requests * fix: test failure
This commit is contained in:
@@ -15,6 +15,6 @@ func BuildDirectTarget(endpoints []string) string {
|
||||
|
||||
// BuildDiscovTarget returns a string that represents the given endpoints with discov schema.
|
||||
func BuildDiscovTarget(endpoints []string, key string) string {
|
||||
return fmt.Sprintf("%s://%s/%s", internal.DiscovScheme,
|
||||
return fmt.Sprintf("%s://%s/%s", internal.EtcdScheme,
|
||||
strings.Join(endpoints, internal.EndpointSep), key)
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ func TestBuildDirectTarget(t *testing.T) {
|
||||
|
||||
func TestBuildDiscovTarget(t *testing.T) {
|
||||
target := BuildDiscovTarget([]string{"localhost:123", "localhost:456"}, "foo")
|
||||
assert.Equal(t, "discov://localhost:123,localhost:456/foo", target)
|
||||
assert.Equal(t, "etcd://localhost:123,localhost:456/foo", target)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user