From 0b3e544143b99652fcc433809a72a6128f350c25 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Mon, 30 Mar 2026 12:31:51 +0100 Subject: [PATCH] fix(cmd/edit): implement removal of "last modified" comments The removeLastModifiedComments function previously copied all lines without filtering. This change adds logic to remove lines containing "last modified" (case-insensitive) after trimming whitespace. --- cmd/edit.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/edit.go b/cmd/edit.go index 973693d..f7f9dc5 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -103,7 +103,11 @@ var editCmd = &cobra.Command{ func removeLastModifiedComments(content string) string { lines := strings.Split(content, "\n") cleanedLines := make([]string, 0, len(lines)) - cleanedLines = append(cleanedLines, lines...) - + for _, line := range lines { + trimmed := strings.TrimSpace(line) + if !strings.Contains(strings.ToLower(trimmed), "last modified") { + cleanedLines = append(cleanedLines, line) + } + } return strings.Join(cleanedLines, "\n") -} +} \ No newline at end of file