refactor: Rename clean function to cleanMessage for clarity and consistency
The code changes in `aviation_parser.go` and `aviation_parser_test.go` rename the `clean` function to `cleanMessage` to improve clarity and consistency in function naming. This change ensures that the function's purpose is more accurately reflected in its name, making it easier for developers to understand and maintain the code.
This commit is contained in:
@@ -164,7 +164,7 @@ func Parse(rawText string) (*domain.ParsedMessage, error) {
|
||||
return &message, nil
|
||||
}
|
||||
|
||||
func clean(text string) string {
|
||||
func cleanMessage(text string) string {
|
||||
cleanedText := emptyLineRemove.ReplaceAllString(text, "")
|
||||
cleanText := strings.ReplaceAll(cleanedText, "\n\n", "\n")
|
||||
if match := bodyOnly.FindStringSubmatch(cleanText); len(match) > 1 {
|
||||
@@ -179,7 +179,7 @@ func clean(text string) string {
|
||||
|
||||
func ParseHeader(fullMessage string) (domain.ParsedMessage, error) {
|
||||
log := utils.GetSugaredLogger()
|
||||
fullMessage = clean(fullMessage)
|
||||
fullMessage = cleanMessage(fullMessage)
|
||||
lines := strings.Split(fullMessage, "\n")
|
||||
|
||||
if len(lines) < 3 {
|
||||
|
||||
Reference in New Issue
Block a user