MCPcopy
hub / github.com/natefinch/lumberjack / makeTempDir

Function makeTempDir

lumberjack_test.go:713–718  ·  view source on GitHub ↗

makeTempDir creates a file with a semi-unique name in the OS temp directory. It should be based on the name of the test, to keep parallel tests from colliding, and must be cleaned up after the test is finished.

(name string, t testing.TB)

Source from the content-addressed store, hash-verified

711// It should be based on the name of the test, to keep parallel tests from
712// colliding, and must be cleaned up after the test is finished.
713func makeTempDir(name string, t testing.TB) string {
714 dir := time.Now().Format(name + backupTimeFormat)
715 dir = filepath.Join(os.TempDir(), dir)
716 isNilUp(os.Mkdir(dir, 0700), t, 1)
717 return dir
718}
719
720// existsWithContent checks that the given file exists and has the correct content.
721func existsWithContent(path string, content []byte, t testing.TB) {

Callers 15

TestMaintainModeFunction · 0.85
TestMaintainOwnerFunction · 0.85
TestCompressMaintainModeFunction · 0.85
TestNewFileFunction · 0.85
TestOpenExistingFunction · 0.85
TestWriteTooLongFunction · 0.85
TestAutoRotateFunction · 0.85
TestFirstWriteRotateFunction · 0.85
TestMaxBackupsFunction · 0.85
TestMaxAgeFunction · 0.85

Calls 1

isNilUpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…