MCPcopy Index your code
hub / github.com/firecracker-microvm/firecracker-containerd / createTempConfig

Function createTempConfig

config/config_test.go:66–78  ·  view source on GitHub ↗
(t *testing.T, contents string)

Source from the content-addressed store, hash-verified

64}
65
66func createTempConfig(t *testing.T, contents string) (string, func()) {
67 t.Helper()
68 configFile, err := os.CreateTemp("", "config")
69 if err != nil {
70 t.Fatal(err, "failed to create temp config file")
71 }
72 err = os.WriteFile(configFile.Name(), []byte(contents), 0644)
73 if err != nil {
74 os.Remove(configFile.Name())
75 t.Fatal(err, "failed to write contents to temp config file")
76 }
77 return configFile.Name(), func() { os.Remove(configFile.Name()) }
78}

Callers 2

TestLoadConfigDefaultsFunction · 0.85
TestLoadConfigOverridesFunction · 0.85

Calls 2

NameMethod · 0.65
RemoveMethod · 0.45

Tested by

no test coverage detected