Skip to content

Commit

Permalink
GODRIVER-2949 Ignore address case.
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Nov 7, 2023
1 parent 26a8f94 commit 35ae691
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions mongo/address/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func (a Address) Network() string {
// String is the canonical version of this address, e.g. localhost:27017,
// 1.2.3.4:27017, example.com:27017.
func (a Address) String() string {
// TODO: unicode case folding?
s := strings.ToLower(string(a))
s := string(a)
if len(s) == 0 {
return ""
}
Expand Down
8 changes: 4 additions & 4 deletions mongo/address/addr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func TestAddress_String(t *testing.T) {
expected string
}{
{"a", "a:27017"},
{"A", "a:27017"},
{"A:27017", "a:27017"},
{"A", "A:27017"},
{"A:27017", "A:27017"},
{"a:27017", "a:27017"},
{"a.sock", "a.sock"},
}
Expand All @@ -37,8 +37,8 @@ func TestAddress_Canonicalize(t *testing.T) {
expected string
}{
{"a", "a:27017"},
{"A", "a:27017"},
{"A:27017", "a:27017"},
{"A", "A:27017"},
{"A:27017", "A:27017"},
{"a:27017", "a:27017"},
{"a.sock", "a.sock"},
}
Expand Down

0 comments on commit 35ae691

Please sign in to comment.