MCPcopy Index your code
hub / github.com/github/github-mcp-server / writePackage

Function writePackage

pkg/toolvalidation/readonlyhint_test.go:16–21  ·  view source on GitHub ↗

writePackage writes a single Go source file into a fresh temp directory and returns that directory, suitable for passing to ScanReadOnlyHint.

(t *testing.T, filename, source string)

Source from the content-addressed store, hash-verified

14// writePackage writes a single Go source file into a fresh temp directory and
15// returns that directory, suitable for passing to ScanReadOnlyHint.
16func writePackage(t *testing.T, filename, source string) string {
17 t.Helper()
18 dir := t.TempDir()
19 require.NoError(t, os.WriteFile(filepath.Join(dir, filename), []byte(source), 0o600))
20 return dir
21}
22
23func TestScanReadOnlyHint(t *testing.T) {
24 t.Parallel()

Callers 1

TestScanReadOnlyHintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected