code: func (r *Resolver) ResolvePackage(ctx context.Context, pkg, ver string) (pin common.Pin, err error) {
  	if err = common.ValidatePackageName(pkg); err != nil {
  		return
  	}
  	if err = common.ValidateInstanceVersion(ver); err != nil {
  		return
  	}
  
  	// If a version looks like IID already just use it as a pin right away.
  	if common.ValidateInstanceID(ver, common.AnyHash) == nil {
  		pin = common.Pin{PackageName: pkg, InstanceID: ver}
  	} else {
  		pin, err = r.resolveVersion(ctx, pkg, ver)
  		if err != nil {
  			return
  		}
  	}
  
  	if r.VerifyPresence {
  		err = r.verifyPin(ctx, pin)
  	}
  
  	if err == nil && r.Visitor != nil {
  		r.Visitor(pkg, ver, pin.InstanceID)
  	}
  
  	return
  }
docs: // ResolvePackage resolves the package's version into a concrete instance ID
  // and (if Resolver.VerifyPresence is true) verifies it exists.