code: func cleanCacheDir() {
  	dir := osutil.CacheDir()
  	f, err := os.Open(dir)
  	if err != nil {
  		return
  	}
  	defer f.Close()
  	fis, err := f.Readdir(-1)
  	if err != nil {
  		return
  	}
  	var haveCache, statCache []os.FileInfo
  	seen := make(map[string]bool)
  	for _, fi := range fis {
  		seen[fi.Name()] = true
  	}
  
  	for _, fi := range fis {
  		if strings.HasPrefix(fi.Name(), "pk-put.havecache.") {
  			haveCache = append(haveCache, fi)
  			continue
  		}
  		if strings.HasPrefix(fi.Name(), "pk-put.statcache.") {
  			statCache = append(statCache, fi)
  			continue
  		}
  	}
  	for _, list := range [][]os.FileInfo{haveCache, statCache} {
  		if len(list) <= 5 {
  			continue
  		}
  		sort.Sort(byModtime(list))
  		list = list[:len(list)-5]
  		for _, fi := range list {
  			if fi.ModTime().Before(time.Now().Add(-30 * 24 * time.Hour)) {
  				os.RemoveAll(filepath.Join(dir, fi.Name()))
  			}
  		}
  	}
  }
docs: // Delete all but the oldest 5 havecache/statcache dirs, unless they're newer
  // than 30 days.