code: func (s *Action) Fsck(ctx context.Context, c *cli.Context) error {
  	out.Print(ctx, "Checking store integrity ...")
  	// make sure config is in the right place
  	// we may have loaded it from one of the fallback locations
  	if err := s.cfg.Save(); err != nil {
  		return ExitError(ctx, ExitConfig, err, "failed to save config: %s", err)
  	}
  
  	// clean up any previous config locations
  	oldCfg := filepath.Join(config.Homedir(), ".gopass.yml")
  	if fsutil.IsFile(oldCfg) {
  		if err := os.Remove(oldCfg); err != nil {
  			out.Error(ctx, "Failed to remove old gopass config %s: %s", oldCfg, err)
  		}
  	}
  
  	// display progress bar
  	t, err := s.Store.Tree(ctx)
  	if err != nil {
  		return ExitError(ctx, ExitUnknown, err, "failed to list stores: %s", err)
  	}
  
  	pwList := t.List(0)
  
  	bar := &goprogressbar.ProgressBar{
  		Total: int64(len(pwList) * 2),
  		Width: 120,
  	}
  	if out.IsHidden(ctx) {
  		old := goprogressbar.Stdout
  		goprogressbar.Stdout = ioutil.Discard
  		defer func() {
  			goprogressbar.Stdout = old
  		}()
  	}
  
  	ctx = ctxutil.WithProgressCallback(ctx, func() {
  		bar.Current++
  		bar.Text = fmt.Sprintf("%d of %d objects checked", bar.Current, bar.Total)
  		bar.LazyPrint()
  	})
  	ctx = out.AddPrefix(ctx, "\n")
  
  	// the main work in done by the sub stores
  	if err := s.Store.Fsck(ctx, c.Args().Get(0)); err != nil {
  		return ExitError(ctx, ExitFsck, err, "fsck found errors: %s", err)
  	}
  	return nil
  }
docs: // Fsck checks the store integrity