Skip to content

Commit 173111f

Browse files
dveedenlance6716
andauthored
Update serialization/serialization.go
Co-authored-by: lance6716 <[email protected]>
1 parent 14de33c commit 173111f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

serialization/serialization.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ type Message struct {
2121
fieldIndex map[string]uint8
2222
}
2323

24-
func (m *Message) String() (text string) {
25-
text += fmt.Sprintf("Message (version: %d)", m.Version)
26-
for _, line := range m.Format.stringParts() {
27-
text += "\n " + line
28-
}
29-
return
24+
func (m *Message) String() string {
25+
parts := []string{fmt.Sprintf("Message (version: %d)", m.Version)}
26+
parts = append(parts, m.Format.stringParts()...)
27+
return strings.Join(parts, "\n ")
3028
}
3129

3230
// GetFieldByName returns a field if the name matches and an error if there is no match

0 commit comments

Comments
 (0)