node: fix whitespace in generated comments

This commit is contained in:
mappu 2020-04-16 18:37:27 +12:00
parent ae04fa73ef
commit fe654d70cc

View File

@ -77,7 +77,7 @@ func normaliseCommentStrFragment(s string) string {
lines[i] = lines[i][2:]
}
}
return `/* ` + strings.TrimRight(strings.Join(lines, "\n"), "\n") + `*/`
return `/*` + strings.TrimRight(strings.Join(lines, "\n"), "\n") + ` */`
}
func normaliseCommentStr(s string) string {
@ -98,7 +98,7 @@ func normaliseCommentStr(s string) string {
} else { // len(parts) == 2
// Range comment part is OK
// Only second middle part needs normalising
ret = append(ret, parts[0], normaliseCommentStrFragment(parts[1]))
ret = append(ret, `/*`+parts[0]+`*/`, normaliseCommentStrFragment(parts[1]))
}
}