code: func newTempFile(dir, prefix, suffix string) (*os.File, error) {
  	for index := 1; index < 10000; index++ {
  		path := filepath.Join(dir, fmt.Sprintf("%s%03d%s", prefix, index, suffix))
  		if _, err := os.Stat(path); err != nil {
  			return os.Create(path)
  		}
  	}
  	// Give up
  	return nil, fmt.Errorf("could not create file of the form %s%03d%s", prefix, 1, suffix)
  }
docs: // newTempFile returns a new output file in dir with the provided prefix and suffix.