Unexport URI.Normalize

This commit is contained in:
Cody Soyland 2018-07-05 21:55:31 -05:00
parent a7c1795cf7
commit 6f256e0edb
2 changed files with 4 additions and 4 deletions

6
uri.go
View file

@ -117,8 +117,8 @@ func (u *URI) HostPort() string {
return s
}
// Normalize returns the address in a form usable by a HTTP client.
func (u *URI) Normalize() string {
// normalize returns the address in a form usable by a HTTP client.
func (u *URI) normalize() string {
scheme := u.Scheme
index := strings.Index(scheme, "+")
if index >= 0 {
@ -134,7 +134,7 @@ func (u URI) String() string {
// Path returns URI with path
func (u *URI) Path(path string) string {
return fmt.Sprintf("%s%s", u.Normalize(), path)
return fmt.Sprintf("%s%s", u.normalize(), path)
}
// The following methods are required to implement pflag Value interface.

View file

@ -60,7 +60,7 @@ func TestNormalizedAddress(t *testing.T) {
if err != nil {
t.Fatalf("Can't parse address")
}
if uri.Normalize() != "http://big-data.pilosa.com:6888" {
if uri.normalize() != "http://big-data.pilosa.com:6888" {
t.Fatalf("Normalized address is not normal")
}
}