MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / createTempFile

Function createTempFile

rest/config_test.go:1410–1416  ·  view source on GitHub ↗

createTempFile creates a temporary file with the given content.

(t *testing.T, content []byte)

Source from the content-addressed store, hash-verified

1408
1409// createTempFile creates a temporary file with the given content.
1410func createTempFile(t *testing.T, content []byte) *os.File {
1411 file, err := os.CreateTemp("", "*-sync_gateway.conf")
1412 require.NoError(t, err, "Error creating temp file")
1413 _, err = file.Write(content)
1414 require.NoError(t, err, "Error writing bytes")
1415 return file
1416}
1417
1418// deleteTempFile deletes the given file.
1419func deleteTempFile(t *testing.T, file *os.File) {

Callers 1

TestSetupAndValidateFunction · 0.85

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected