code: func performBatchOperation(ctx context.Context, op batchOperation) ([]pinInfo, error) {
  	op.client.BeginBatch(ctx)
  	defer op.client.EndBatch(ctx)
  
  	pkgs := op.packages
  	if len(pkgs) == 0 {
  		var err error
  		pkgs, err = expandPkgDir(ctx, op.client, op.packagePrefix)
  		if err != nil {
  			return nil, err
  		}
  	}
  	return callConcurrently(pkgs, func(pkg string) pinInfo {
  		pin, err := op.callback(pkg)
  		if err != nil {
  			return pinInfo{Pkg: pkg, Err: err.Error()}
  		}
  		return pinInfo{Pkg: pkg, Pin: &pin}
  	}), nil
  }
docs: // performBatchOperation expands a package prefix into a list of packages and
  // calls callback for each of them (concurrently) gathering the results.
  //
  // Returns an error only if the prefix expansion fails. Errors from individual
  // operations are returned through []pinInfo, use hasErrors to check them.