Skip to content

Commit

Permalink
manual resolver: delete GenerateAndRegisterManualResolver (#3960)
Browse files Browse the repository at this point in the history
Tests are using WithResolver dial option.
  • Loading branch information
menghanl committed Oct 22, 2020
1 parent 4e8458e commit 0e8f1cd
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions resolver/manual/manual.go
Expand Up @@ -21,9 +21,6 @@
package manual

import (
"strconv"
"time"

"google.golang.org/grpc/resolver"
)

Expand Down Expand Up @@ -81,13 +78,3 @@ func (*Resolver) Close() {}
func (r *Resolver) UpdateState(s resolver.State) {
r.CC.UpdateState(s)
}

// GenerateAndRegisterManualResolver generates a random scheme and a Resolver
// with it. It also registers this Resolver.
// It returns the Resolver and a cleanup function to unregister it.
func GenerateAndRegisterManualResolver() (*Resolver, func()) {
scheme := strconv.FormatInt(time.Now().UnixNano(), 36)
r := NewBuilderWithScheme(scheme)
resolver.Register(r)
return r, func() { resolver.UnregisterForTesting(scheme) }
}

0 comments on commit 0e8f1cd

Please sign in to comment.