Dir is wrapping an temporary directory on disk.
type Dir struct { // Name is the name (full path) of the created directory. Name string }
func CreateTempDir(prefix string) (*Dir, error)
CreateTempDir returns a new Directory wrapping a temporary directory on disk.
func (d *Dir) Delete() error
Delete the underlying directory, and all of its content.
func (d *Dir) NewFile(name string) (io.WriteCloser, error)
NewFile creates a new file in the specified directory.
Directory is an interface to a temporary directory, in which you can create new files.
type Directory interface { // NewFile creates a new file in that directory. Calling NewFile // with the same filename twice will result in an error. NewFile(name string) (io.WriteCloser, error) // Delete removes the directory and its content. Delete() error }