lint: optional json structs must be ptrs

This commit is contained in:
Christopher F 2018-08-23 18:51:01 -04:00
parent 20f5db7e50
commit 59811adafe
3 changed files with 18 additions and 18 deletions

View File

@ -69,22 +69,22 @@ const (
)
type message struct {
Op string `json:"op"`
GuildID string `json:"guildId,omitempty"`
SessionID string `json:"sessionId,omitempty"`
Event VoiceServerUpdate `json:"event,omitempty"`
Track string `json:"track,omitempty"`
StartTime string `json:"startTime,omitempty"`
EndTime string `json:"endTime,omitempty"`
Pause bool `json:"pause,omitempty"`
Position int `json:"position,omitempty"`
Volume int `json:"volume,omitempty"`
State state `json:"state,omitempty"`
Type string `json:"type,omitempty"`
Reason string `json:"reason,omitempty"`
Error string `json:"error,omitempty"`
ThresholdMs int `json:"thresholdMs,omitempty"`
StatCPU statCPU `json:"cpu,omitempty"`
Op string `json:"op"`
GuildID string `json:"guildId,omitempty"`
SessionID string `json:"sessionId,omitempty"`
Event *VoiceServerUpdate `json:"event,omitempty"`
Track string `json:"track,omitempty"`
StartTime string `json:"startTime,omitempty"`
EndTime string `json:"endTime,omitempty"`
Pause bool `json:"pause,omitempty"`
Position int `json:"position,omitempty"`
Volume int `json:"volume,omitempty"`
State *state `json:"state,omitempty"`
Type string `json:"type,omitempty"`
Reason string `json:"reason,omitempty"`
Error string `json:"error,omitempty"`
ThresholdMs int `json:"thresholdMs,omitempty"`
StatCPU *statCPU `json:"cpu,omitempty"`
// TODO: stats
}

View File

@ -144,7 +144,7 @@ func (node *Node) CreatePlayer(guildID string, sessionID string, event VoiceServ
Op: opVoiceUpdate,
GuildID: guildID,
SessionID: sessionID,
Event: event,
Event: &event,
}
data, err := json.Marshal(msg)
if err != nil {

View File

@ -134,7 +134,7 @@ func (player *Player) Forward(sessionID string, event VoiceServerUpdate) error {
Op: opVoiceUpdate,
GuildID: player.guildID,
SessionID: sessionID,
Event: event,
Event: &event,
}
data, err := json.Marshal(msg)
if err != nil {