package tempfile

import "github.com/docker/docker/pkg/testutil/tempfile"

Index

Types

type TempFile

type TempFile struct {
	File *os.File
}

TempFile is a temporary file that can be used with unit tests. TempFile reduces the boilerplate setup required in each test case by handling setup errors.

func NewTempFile

func NewTempFile(t assert.TestingT, prefix string, content string) *TempFile

NewTempFile returns a new temp file with contents

func (*TempFile) Name

func (f *TempFile) Name() string

Name returns the filename

func (*TempFile) Remove

func (f *TempFile) Remove()

Remove removes the file

Source Files

tempfile.go

Version
v1.13.0-rc5
Published
Jan 4, 2017
Platform
js/wasm
Imports
3 packages
Last checked
13 minutes ago

Tools for package owners.