Skip to content

Commit

Permalink
update the doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Jun 28, 2020
1 parent bdb3db3 commit 6086fc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions krpc/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,21 @@ func (m Message) IsError() bool {

// RID returns the value named "id" in "r".
//
// Return "" instead if no "id".
// Return the ZERO value instead if no "id".
func (m Message) RID() metainfo.Hash {
return m.R.ID
}

// QID returns the value named "id" in "a", that's, the query arguments.
//
// Return "" instead if no "id".
// Return the ZERO value instead if no "id".
func (m Message) QID() metainfo.Hash {
return m.A.ID
}

// ID returns the QID or RID.
//
// Notice: it will panic if the the message is not a query or response.
func (m Message) ID() metainfo.Hash {
switch m.Y {
case "q":
Expand Down

0 comments on commit 6086fc5

Please sign in to comment.