code: func NewAtomicWriter(targetDir string, logContext string) (*AtomicWriter, error) {
  	_, err := os.Stat(targetDir)
  	if os.IsNotExist(err) {
  		return nil, err
  	}
  
  	return &AtomicWriter{targetDir: targetDir, logContext: logContext}, nil
  }
docs: // NewAtomicWriter creates a new AtomicWriter configured to write to the given
  // target directory, or returns an error if the target directory does not exist.