Skip to content

Commit

Permalink
Documentation for newly introduced methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Byrd committed Nov 10, 2016
1 parent a6c1dce commit acbbb52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions inline.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ type InlineQueryResult interface {
// InlineQueryResults is a slice wrapper for convenient marshalling.
type InlineQueryResults []InlineQueryResult

// MarshalJSON makes sure IQRs have proper IDs and Type variables set.
//
// If ID of some result appears empty, it gets set to a new hash.
// JSON-specific Type gets infered from the actual (specific) IQR type.
func (results *InlineQueryResults) MarshalJSON() ([]byte, error) {
for i, result := range *results {
if result.GetID() == "" {
Expand Down
2 changes: 1 addition & 1 deletion inline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (result *InlineQueryResultBase) GetID() string {
return result.ID
}

// GetID is part of IQRBase's implementation of IQR interface.
// SetID is part of IQRBase's implementation of IQR interface.
func (result *InlineQueryResultBase) SetID(id string) {
result.ID = id
}
Expand Down

0 comments on commit acbbb52

Please sign in to comment.