Skip to content

Commit 6e15d2f

Browse files
committed
deserialize: Use quote to print possibly-invalid string
An openshift/machine-config-operator user wrote an invalid unit, and printing the contents as a byte array is unnecessary; it's almost certain to be a valid string, we just found a syntax error.
1 parent d657f96 commit 6e15d2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unit/deserialize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (l *lexer) lexSectionSuffixFunc(section string) lexStep {
123123

124124
garbage = bytes.TrimSpace(garbage)
125125
if len(garbage) > 0 {
126-
return nil, fmt.Errorf("found garbage after section name %s: %v", l.section, garbage)
126+
return nil, fmt.Errorf("found garbage after section name %s: %q", l.section, garbage)
127127
}
128128

129129
return l.lexNextSectionOrOptionFunc(section), nil

0 commit comments

Comments
 (0)