Skip to content

Commit

Permalink
Added comment for WireMessage.Marshal
Browse files Browse the repository at this point in the history
  • Loading branch information
linux4life798 committed Oct 2, 2018
1 parent 752cf3a commit 49ee38f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wiremessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ func (fs fieldNumArray) Len() int { return len(fs) }
func (fs fieldNumArray) Swap(i, j int) { fs[i], fs[j] = fs[j], fs[i] }
func (fs fieldNumArray) Less(i, j int) bool { return fs[i] < fs[j] }

// Marshal generates the byte stream for a given WireMessage
func (m *WireMessage) Marshal() ([]byte, error) {
fields := fieldNumArray(m.GetFieldNums())
sort.Sort(fields) // protobuf encoding should be in increaing key order
Expand Down

0 comments on commit 49ee38f

Please sign in to comment.