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)
| 14 | // writePackage writes a single Go source file into a fresh temp directory and |
| 15 | // returns that directory, suitable for passing to ScanReadOnlyHint. |
| 16 | func 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 | |
| 23 | func TestScanReadOnlyHint(t *testing.T) { |
| 24 | t.Parallel() |
no outgoing calls
no test coverage detected