Fix some go linter warnings

This commit is contained in:
2025-11-15 16:42:46 +01:00
parent 4fb25d0463
commit 5f1fdfa6c1
8 changed files with 84 additions and 99 deletions

View File

@@ -22,9 +22,9 @@ type CaptureGroup struct {
Range [2]int
}
// ProcessContent applies regex replacement with Lua processing
// The filename here exists ONLY so we can pass it to the lua environment
// It's not used for anything else
// ProcessRegex applies regex replacement with Lua processing.
// The filename here exists ONLY so we can pass it to the lua environment.
// It's not used for anything else.
func ProcessRegex(content string, command utils.ModifyCommand, filename string) ([]utils.ReplaceCommand, error) {
processRegexLogger := regexLogger.WithPrefix("ProcessRegex").WithField("commandName", command.Name).WithField("file", filename)
processRegexLogger.Debug("Starting regex processing for file")
@@ -216,9 +216,6 @@ func ProcessRegex(content string, command utils.ModifyCommand, filename string)
}
if replacement == "" {
// Apply the modifications to the original match
replacement = matchContent
// Count groups that were actually modified
modifiedGroupsCount := 0
for _, capture := range updatedCaptureGroups {