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

Function writeTempTokenFile

credentials/jwt/token_file_call_creds_ext_test.go:257–265  ·  view source on GitHub ↗

writeTempTokenFile writes the token to a temporary file and returns the path.

(t *testing.T, token string)

Source from the content-addressed store, hash-verified

255
256// writeTempTokenFile writes the token to a temporary file and returns the path.
257func writeTempTokenFile(t *testing.T, token string) string {
258 t.Helper()
259 tempDir := t.TempDir()
260 filePath := filepath.Join(tempDir, "token")
261 if err := os.WriteFile(filePath, []byte(token), 0600); err != nil {
262 t.Fatalf("Failed to write temp token file: %v", err)
263 }
264 return filePath
265}

Calls 2

JoinMethod · 0.80
FatalfMethod · 0.65

Tested by

no test coverage detected