Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolver: update Resolver.Scheme() docstring to mention requirement of lowercase scheme names #6014

Merged
merged 6 commits into from
Feb 15, 2023
8 changes: 7 additions & 1 deletion resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (s) TestResolverCaseSensitivity(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected Dial(%q) error: %v", target, err)
}
cc.Connect()
if got, want := <-addrCh, "localhost:1234"; got != want {
cc.Close()
t.Fatalf("Dialer got address %q; wanted %q", got, want)
Expand All @@ -88,10 +89,15 @@ func (s) TestResolverCaseSensitivity(t *testing.T) {
// globally-registered resolver. Since it is "dns" instead of passthrough,
// we can validate by checking for an address that has been resolved
// (i.e. is not "localhost:port").
cc, err = Dial(target, WithContextDialer(customDialer), WithResolvers(res), WithTransportCredentials(insecure.NewCredentials()))

// WithDisableServiceConfig disables TXT lookups, which can hang for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// "localhost".
cc, err = Dial(target, WithContextDialer(customDialer), WithResolvers(res),
WithTransportCredentials(insecure.NewCredentials()), WithDisableServiceConfig())
if err != nil {
t.Fatalf("Unexpected Dial(%q) error: %v", target, err)
}
cc.Connect()
defer cc.Close()
if got, wantNot := <-addrCh, "localhost:1234"; got == wantNot {
t.Fatalf("Dialer got address %q; wanted something other than %q", got, wantNot)
Expand Down