diff --git a/uri.go b/uri.go index 401ec1ad7..8f9df2b72 100644 --- a/uri.go +++ b/uri.go @@ -82,8 +82,8 @@ func NewURIFromAddress(address string) (*URI, error) { return parseAddress(address) } -// SetScheme sets the scheme of this URI. -func (u *URI) SetScheme(scheme string) error { +// setScheme sets the scheme of this URI. +func (u *URI) setScheme(scheme string) error { m := schemeRegexp.FindStringSubmatch(scheme) if m == nil { return errors.New("invalid scheme") diff --git a/uri_internal_test.go b/uri_internal_test.go index 07da55226..9bc6403d7 100644 --- a/uri_internal_test.go +++ b/uri_internal_test.go @@ -79,7 +79,7 @@ func TestURIPath(t *testing.T) { func TestSetScheme(t *testing.T) { uri := defaultURI() target := "fun" - err := uri.SetScheme(target) + err := uri.setScheme(target) if err != nil { t.Fatal(err) } @@ -111,7 +111,7 @@ func TestSetPort(t *testing.T) { func TestSetInvalidScheme(t *testing.T) { uri := defaultURI() - err := uri.SetScheme("?invalid") + err := uri.setScheme("?invalid") if err == nil { t.Fatalf("Should have failed") } diff --git a/utils_internal_test.go b/utils_internal_test.go index 88b1473c0..bf2c4f01f 100644 --- a/utils_internal_test.go +++ b/utils_internal_test.go @@ -56,7 +56,7 @@ func NewTestCluster(n int) *cluster { // NewTestURI is a test URI creator that intentionally swallows errors. func NewTestURI(scheme, host string, port uint16) URI { uri := defaultURI() - uri.SetScheme(scheme) + uri.setScheme(scheme) uri.setHost(host) uri.SetPort(port) return *uri