code: func WalkPods(dataDir string, include IncludeMask, f func(*Pod)) error {
  	if err := initPods(dataDir); err != nil {
  		return err
  	}
  
  	ls, err := listPods(dataDir, include)
  	if err != nil {
  		return errwrap.Wrap(errors.New("failed to get pods"), err)
  	}
  	sort.Strings(ls)
  
  	for _, uuid := range ls {
  		u, err := types.NewUUID(uuid)
  		if err != nil {
  			fmt.Fprintf(os.Stderr, "skipping %q: %v", uuid, err)
  			continue
  		}
  		p, err := getPod(dataDir, u)
  		if err != nil {
  			fmt.Fprintf(os.Stderr, "skipping %q: %v", uuid, err)
  			continue
  		}
  
  		// omit pods found in unrequested states
  		// this is to cover a race between listPods finding the uuids and pod states changing
  		// it's preferable to keep these operations lock-free, for example a `rkt gc` shouldn't block `rkt run`.
  		if p.isEmbryo && include&IncludeEmbryoDir == 0 ||
  			p.isExitedGarbage && include&IncludeExitedGarbageDir == 0 ||
  			p.isGarbage && include&IncludeGarbageDir == 0 ||
  			p.isPrepared && include&IncludePreparedDir == 0 ||
  			((p.isPreparing || p.isAbortedPrepare) && include&IncludePrepareDir == 0) ||
  			p.isRunning() && include&IncludeRunDir == 0 {
  			p.Close()
  			continue
  		}
  
  		f(p)
  		p.Close()
  	}
  
  	return nil
  }
docs: // WalkPods iterates over the included directories calling function f for every pod found.
  // The pod will be closed after the function 'f' is executed.