diff --git a/core/coreapi/name.go b/core/coreapi/name.go index 4792196b6..ec653a394 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -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