From 516644ffdecaee00d9cd4d95b4dc4bef4b33ecff Mon Sep 17 00:00:00 2001 From: nitroflap Date: Fri, 18 Jun 2021 21:50:23 +0300 Subject: [PATCH] Godoc fix --- components.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components.go b/components.go index a998dd39b..6b74e1708 100644 --- a/components.go +++ b/components.go @@ -20,10 +20,13 @@ type MessageComponent interface { Type() ComponentType } +// UnmarshableMessageComponent is just a helper for components which need ability to be unmarshaled (like the ones in messages). +// Since MessageComponent is an interface - json.Unmarshal can't unmarshal it properly. type UnmarshableMessageComponent struct { MessageComponent } +// UnmarshalJSON is a helper function to unmarshal MessageComponent object. func (umc *UnmarshableMessageComponent) UnmarshalJSON(src []byte) (err error) { var v struct { Type ComponentType `json:"type"`