Skip to content

Commit

Permalink
store the parsed url by value in resolver.Target
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Oct 1, 2021
1 parent 5cff707 commit c36957f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clientconn.go
Expand Up @@ -1694,6 +1694,6 @@ func parseTarget(target string) (resolver.Target, error) {
Scheme: u.Scheme,
Authority: u.Host,
Endpoint: endpoint,
ParsedURL: u,
ParsedURL: *u,
}, nil
}
3 changes: 0 additions & 3 deletions internal/resolver/unix/unix.go
Expand Up @@ -43,9 +43,6 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolv
// resolver implementations we ended up stripping the leading "/" from the
// endpoint. This obviously does not work for the "unix" scheme. Hence we
// end up using the parsed URL instead.
if target.ParsedURL == nil {
return nil, fmt.Errorf("nil ParsedURL in received target: %+v", target)
}
endpoint := target.ParsedURL.Path
if endpoint == "" {
endpoint = target.ParsedURL.Opaque
Expand Down
2 changes: 1 addition & 1 deletion resolver/resolver.go
Expand Up @@ -230,7 +230,7 @@ type Target struct {
// added to it if the original dial target contained no scheme or contained
// an unregistered scheme. Any query params specified in the original dial
// target can be accessed from here.
ParsedURL *url.URL
ParsedURL url.URL
}

// Builder creates a resolver that will be used to watch name resolution updates.
Expand Down

0 comments on commit c36957f

Please sign in to comment.