From cff7da1def1f9354a746e897920ba245402487f5 Mon Sep 17 00:00:00 2001 From: Rudra Gupta Date: Tue, 17 Sep 2024 11:40:56 -0400 Subject: [PATCH] fix: replace newline with space and trim spaces --- cmd/generate-raid.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/generate-raid.go b/cmd/generate-raid.go index 3202f1a..30762f9 100644 --- a/cmd/generate-raid.go +++ b/cmd/generate-raid.go @@ -209,8 +209,9 @@ func readData() (data ComponentDefinition, err error) { data.Controls[i].IDFriendly = strings.ReplaceAll(data.Controls[i].ID, ".", "_") // loop over objectives in test_requirements and replace newlines with empty string for k, v := range data.Controls[i].TestRequirements { - data.Controls[i].TestRequirements[k] = strings.Replace(v, "\n", "", -1) + data.Controls[i].TestRequirements[k] = strings.TrimSpace(strings.ReplaceAll(v, "\n", " ")) } + } return }