diff --git a/net/ping/ping.go b/net/ping/ping.go index 9ef3b67..a595060 100644 --- a/net/ping/ping.go +++ b/net/ping/ping.go @@ -77,12 +77,12 @@ func (r *PingResponse) GetError() string { } type PingSummary struct { - SendCount int - ReceiveCount int - LossPercent float32 - MinTime float32 - MaxTime float32 - AvgTime float32 + SendCount int `json:"sendCount,omitempty"` + ReceiveCount int `json:"receiveCount,omitempty"` + LossPercent float32 `json:"lossPercent,omitempty"` + MinTime float32 `json:"minTime,omitempty"` + MaxTime float32 `json:"maxTime,omitempty"` + AvgTime float32 `json:"avgTime,omitempty"` } func (s *PingSummary) GetSendCount() int { @@ -105,8 +105,8 @@ func (s *PingSummary) GetAvgTime() float32 { } type PingResult struct { - Responses map[int]Response - Summary Summary + Responses map[int]Response `json:"responses,omitempty"` + Summary Summary `json:"summary,omitempty"` } func (r *PingResult) GetResponses() map[int]Response {