MCPcopy
hub / github.com/grpc/grpc-go / createTmpFile

Function createTmpFile

credentials/tls/certprovider/pemfile/watcher_test.go:166–178  ·  view source on GitHub ↗
(t *testing.T, src, dst string)

Source from the content-addressed store, hash-verified

164}
165
166func createTmpFile(t *testing.T, src, dst string) {
167 t.Helper()
168
169 data, err := os.ReadFile(src)
170 if err != nil {
171 t.Fatalf("os.ReadFile(%q) failed: %v", src, err)
172 }
173 if err := os.WriteFile(dst, data, os.ModePerm); err != nil {
174 t.Fatalf("os.WriteFile(%q) failed: %v", dst, err)
175 }
176 t.Logf("Wrote file at: %s", dst)
177 t.Logf("%s", string(data))
178}
179
180func removeTmpFile(t *testing.T, filePath string) {
181 t.Helper()

Calls 2

FatalfMethod · 0.65
LogfMethod · 0.65

Tested by

no test coverage detected