(line string)
| 406 | } |
| 407 | |
| 408 | func 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 | |
| 418 | func parseFrom(args string) (base string, alias string) { |
| 419 | tokens := strings.Fields(args) |