MCPcopy
hub / github.com/nats-io/nats.go / createConfFile

Function createConfFile

test/helper_test.go:140–153  ·  view source on GitHub ↗
(t *testing.T, content []byte)

Source from the content-addressed store, hash-verified

138}
139
140func createConfFile(t *testing.T, content []byte) string {
141 t.Helper()
142 conf, err := os.CreateTemp("", "")
143 if err != nil {
144 t.Fatalf("Error creating conf file: %v", err)
145 }
146 fName := conf.Name()
147 conf.Close()
148 if err := os.WriteFile(fName, content, 0666); err != nil {
149 os.Remove(fName)
150 t.Fatalf("Error writing conf file: %v", err)
151 }
152 return fName
153}

Calls 3

FatalfMethod · 0.80
NameMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected