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

Function dumpFileSystem

provisioner/terraform/cleanup_test.go:181–196  ·  view source on GitHub ↗
(t *testing.T, fs afero.Fs)

Source from the content-addressed store, hash-verified

179}
180
181func dumpFileSystem(t *testing.T, fs afero.Fs) []byte {
182 var buffer bytes.Buffer
183 err := afero.Walk(fs, "/", func(path string, info os.FileInfo, err error) error {
184 _, _ = buffer.WriteString(path)
185 _ = buffer.WriteByte(' ')
186 if info.IsDir() {
187 _ = buffer.WriteByte('d')
188 } else {
189 _ = buffer.WriteByte('f')
190 }
191 _ = buffer.WriteByte('\n')
192 return nil
193 })
194 require.NoError(t, err, "can't dump the file system")
195 return buffer.Bytes()
196}

Callers 1

diffFileSystemFunction · 0.85

Calls 2

WriteStringMethod · 0.80
BytesMethod · 0.45

Tested by

no test coverage detected