use predefined endpoint separator

This commit is contained in:
kevin
2020-08-25 18:36:30 +08:00
parent f3c367a323
commit 456b395860
4 changed files with 18 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ type discovBuilder struct{}
func (d *discovBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (
resolver.Resolver, error) {
hosts := strings.FieldsFunc(target.Authority, func(r rune) bool {
return r == EndpointSep
return r == EndpointSepChar
})
sub, err := discov.NewSubscriber(hosts, target.Endpoint)
if err != nil {