Commit f192228
authored
discordgo: self-reference Container for UnmarshalJSON (#2044)
This lets users access the fields of a discordgo.Container for
components v2.
The current implementation unmarshals only into a container's
components, not the other fields; by adding a self-reference to the
struct we're unmarshalling into, we can ensure all fields are captured
properly. This is effectively the exact inverse of MarshalJSON.
Signed-off-by: Luca Zeuch <l-zeuch@email.de>1 parent ad582a3 commit f192228
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
| 791 | + | |
791 | 792 | | |
| 793 | + | |
792 | 794 | | |
793 | 795 | | |
| 796 | + | |
794 | 797 | | |
795 | 798 | | |
796 | 799 | | |
797 | 800 | | |
| 801 | + | |
798 | 802 | | |
| 803 | + | |
799 | 804 | | |
| 805 | + | |
800 | 806 | | |
801 | 807 | | |
802 | 808 | | |
| |||
0 commit comments