MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / dockerBuildRootDirFiles

Function dockerBuildRootDirFiles

internal/test/docker.go:371–393  ·  view source on GitHub ↗
(buildRoot embed.FS, dir string)

Source from the content-addressed store, hash-verified

369}
370
371func dockerBuildRootDirFiles(buildRoot embed.FS, dir string) map[string][]byte {
372 result := map[string][]byte{}
373 fsEntries, err := buildRoot.ReadDir(dir)
374 if err != nil {
375 panic(err)
376 }
377 for _, fsEntry := range fsEntries {
378 fullPath := dir + "/" + fsEntry.Name()
379 if fsEntry.IsDir() {
380 subDirFiles := dockerBuildRootDirFiles(buildRoot, fullPath)
381 for fileName, fileContent := range subDirFiles {
382 result[fileName] = fileContent
383 }
384 } else {
385 data, err := buildRoot.ReadFile(fullPath)
386 if err != nil {
387 panic(err)
388 }
389 result[fullPath] = data
390 }
391 }
392 return result
393}

Callers 1

dockerBuildRootFilesFunction · 0.85

Calls 1

NameMethod · 0.45

Tested by

no test coverage detected