forked from tucnak/telebot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace IQR*.MarshalJSON with InlineQueryResultBase, fixes tucnak#75.
This commit gets rid of multiple redundant copies of MarhsalJSON() method present for all existing IQR. It does so by introducing a new struct called InlineQueryResultBase, which takes care of new Type (for JSON) and existing duplicated ID field. InlineQueryResults is a new helper wrapper for []IQR slices. It implements MarshalJSON, which makes sure IQR.ID and IQR.Type are set properly (by computing a hash and infering IQR type).
- Loading branch information
Ian Byrd
committed
Nov 10, 2016
1 parent
fedfe0d
commit a6c1dce
Showing
2 changed files
with
88 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.