code: func (r *Resolver) resolveVersion(ctx context.Context, pkg, ver string) (common.Pin, error) {
  	unresolved := unresolvedPkg{pkg, ver}
  
  	promise := r.resolving.Get(ctx, unresolved, func(ctx context.Context) (interface{}, error) {
  		logging.Debugf(ctx, "Resolving package %s ...", unresolved)
  		pin, err := r.Client.ResolveVersion(ctx, unresolved.pkg, unresolved.ver)
  		if err == nil {
  			logging.Debugf(ctx, "Resolved package %s => %s", unresolved, pin)
  		} else {
  			logging.Debugf(ctx, "Failed to resolve package %s: %s", unresolved, err)
  		}
  		return pin, err
  	})
  
  	pin, err := promise.Get(ctx)
  	if err != nil {
  		return common.Pin{}, err
  	}
  	return pin.(common.Pin), nil
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // resolveVersion returns a resolved pin for the given package or an error.