fix: cancel resolve search context

We probably don't need to do this, but it can't hurt.
This commit is contained in:
Steven Allen 2020-06-17 19:43:20 -07:00
parent 00de344318
commit 5f19f3bbe8

View File

@ -120,6 +120,9 @@ func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.Name
// Resolve attempts to resolve the newest version of the specified name and
// returns its path.
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (path.Path, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
results, err := api.Search(ctx, name, opts...)
if err != nil {
return nil, err