MCPcopy Index your code
hub / github.com/coder/coder / createFile

Function createFile

agent/filefinder/engine_test.go:219–224  ·  view source on GitHub ↗

createFile creates a file (and parent dirs) at relPath under dir.

(t *testing.T, dir, relPath, content string)

Source from the content-addressed store, hash-verified

217
218// createFile creates a file (and parent dirs) at relPath under dir.
219func createFile(t *testing.T, dir, relPath, content string) {
220 t.Helper()
221 full := filepath.Join(dir, relPath)
222 require.NoError(t, os.MkdirAll(filepath.Dir(full), 0o755))
223 require.NoError(t, os.WriteFile(full, []byte(content), 0o600))
224}
225
226func resultPaths(results []filefinder.Result) []string {
227 paths := make([]string, len(results))

Calls 3

MkdirAllMethod · 0.80
HelperMethod · 0.65
WriteFileMethod · 0.65

Tested by

no test coverage detected