(buildRoot embed.FS, dir string)
| 369 | } |
| 370 | |
| 371 | func 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 | } |
no test coverage detected