Unexport URI.SetScheme

This commit is contained in:
Cody Soyland 2018-07-05 21:55:45 -05:00
parent ac83bf4422
commit 7807b92b13
3 changed files with 5 additions and 5 deletions

4
uri.go
View file

@ -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")

View file

@ -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")
}

View file

@ -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