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

Function removeInlineComment

try/dockerlayers/main.go:408–416  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

406}
407
408func removeInlineComment(line string) string {
409 // Docker ignores inline comments preceded by whitespace. We implement a light-weight check.
410 for i := 0; i < len(line); i++ {
411 if line[i] == '#' && (i == 0 || unicode.IsSpace(rune(line[i-1]))) {
412 return strings.TrimSpace(line[:i])
413 }
414 }
415 return line
416}
417
418func parseFrom(args string) (base string, alias string) {
419 tokens := strings.Fields(args)

Callers 1

readInstructionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected