Skip to content

Commit 9f09493

Browse files
authored
Merge pull request #269 from cbusbey/tostring_fix
message.String() returns rawMessage if set, builds otherwise
2 parents 969a6a7 + 61c5e52 commit 9f09493

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

message.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ func extractField(parsedFieldBytes *TagValue, buffer []byte) (remBytes []byte, e
295295
}
296296

297297
func (m Message) String() string {
298+
if m.rawMessage != nil {
299+
return string(m.rawMessage)
300+
}
301+
298302
return string(m.build())
299303
}
300304

0 commit comments

Comments
 (0)