diff --git a/pkg/ast/document.go b/pkg/ast/document.go index 42ab2be..8944f09 100644 --- a/pkg/ast/document.go +++ b/pkg/ast/document.go @@ -167,6 +167,10 @@ func (doc *Document) Set(input *Assignment, options SetOptions) (bool, error) { existing.Comments = nil for _, comment := range comments { + if len(comment) == 0 && len(comments) == 1 { + continue + } + existing.Comments = append(existing.Comments, NewComment(comment)) } }