MCPcopy Index your code
hub / github.com/nikivdev/go / copyNotes

Function copyNotes

try/dockerlayers/main.go:446–461  ·  view source on GitHub ↗
(args string, aliases map[string]int)

Source from the content-addressed store, hash-verified

444}
445
446func copyNotes(args string, aliases map[string]int) []string {
447 var notes []string
448 source := detectCopySourceStage(args)
449 if source == "" {
450 notes = append(notes, "Takes files from the build context, so editing those files will invalidate this layer.")
451 return notes
452 }
453
454 lowered := strings.ToLower(source)
455 if idx, ok := aliases[lowered]; ok {
456 notes = append(notes, fmt.Sprintf("Copies from stage %d (%s). Cache depends on that stage's output instead of local files.", idx, source))
457 } else {
458 notes = append(notes, fmt.Sprintf("Copies from %q. Make sure the stage or image exists.", source))
459 }
460 return notes
461}
462
463func detectCopySourceStage(args string) string {
464 tokens := strings.Fields(args)

Callers 1

analyzeDockerfileFunction · 0.85

Calls 1

detectCopySourceStageFunction · 0.85

Tested by

no test coverage detected