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

Function createConfFile

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

Source from the content-addressed store, hash-verified

117}
118
119func createConfFile(t *testing.T, content []byte) string {
120 t.Helper()
121 conf, err := os.CreateTemp("", "")
122 if err != nil {
123 t.Fatalf("Error creating conf file: %v", err)
124 }
125 fName := conf.Name()
126 if err := conf.Close(); err != nil {
127 t.Fatalf("Unexpected error: %v", err)
128 }
129 if err := os.WriteFile(fName, content, 0666); err != nil {
130 if err := os.Remove(fName); err != nil {
131 t.Fatalf("Unexpected error: %v", err)
132 }
133 t.Fatalf("Error writing conf file: %v", err)
134 }
135 return fName
136}
137
138func shutdownJSServerAndRemoveStorage(t *testing.T, s *server.Server) {
139 t.Helper()

Callers 11

TestJetStreamErrorsFunction · 0.70
TestPublishMsgFunction · 0.70
TestPublishMsgAsyncFunction · 0.70
TestNewWithAPIPrefixFunction · 0.70
TestNewWithDomainFunction · 0.70
TestAccountInfoFunction · 0.70

Calls 3

FatalfMethod · 0.80
NameMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected