Fix go vet

This commit is contained in:
Tulir Asokan
2018-11-14 01:19:52 +02:00
parent 912bf309d1
commit 2fc3378b71
2 changed files with 10 additions and 3 deletions

View File

@ -197,7 +197,7 @@ type Content struct {
RelatesTo *RelatesTo `json:"m.relates_to,omitempty"`
Command *MatchedCommand `json:"m.command,omitempty"`
PowerLevels
*PowerLevels
Member
Aliases []string `json:"aliases,omitempty"`
Alias string `json:"alias,omitempty"`
@ -234,6 +234,13 @@ func (content *Content) GetRelatesTo() *RelatesTo {
return content.RelatesTo
}
func (content *Content) GetPowerLevels() *PowerLevels {
if content.PowerLevels == nil {
content.PowerLevels = &PowerLevels{}
}
return content.PowerLevels
}
func (content *Content) UnmarshalPowerLevels() (pl PowerLevels, err error) {
err = json.Unmarshal(content.VeryRaw, &pl)
return