code: func TempFile(filesystem fs.Filesystem, dir, prefix string) (f fs.File, err error) {
  	nconflict := 0
  	for i := 0; i < 10000; i++ {
  		name := filepath.Join(dir, prefix+nextSuffix())
  		f, err = filesystem.OpenFile(name, fs.OptReadWrite|fs.OptCreate|fs.OptExclusive, 0600)
  		if fs.IsExist(err) {
  			if nconflict++; nconflict > 10 {
  				randmu.Lock()
  				rand = reseed()
  				randmu.Unlock()
  			}
  			continue
  		}
  		break
  	}
  	return
  }
docs: // TempFile creates a new temporary file in the directory dir
  // with a name beginning with prefix, opens the file for reading
  // and writing, and returns the resulting *os.File.
  // If dir is the empty string, TempFile uses the default directory
  // for temporary files (see os.TempDir).
  // Multiple programs calling TempFile simultaneously
  // will not choose the same file. The caller can use f.Name()
  // to find the pathname of the file. It is the caller's responsibility
  // to remove the file when no longer needed.