fix(cli): fixing ignoring lines starting with '#' in 'policy edit' (#1830)

Fixes #1821
This commit is contained in:
Jarek Kowalski
2022-03-16 08:00:50 -07:00
committed by GitHub
parent 2b8f7453db
commit 3ef81134a1

View File

@@ -75,7 +75,9 @@ func readAndStripComments(fname string) (string, error) {
s := bufio.NewScanner(f)
for s.Scan() {
l := s.Text()
l = strings.TrimSpace(strings.Split(l, "#")[0])
if strings.HasPrefix(strings.TrimSpace(l), "#") {
continue
}
if l != "" {
result = append(result, l)