renaming of variables and updating comment
This commit is contained in:
parent
29376afed4
commit
fcc2813f13
|
|
@ -194,17 +194,17 @@ type ClusterMember struct {
|
||||||
|
|
||||||
type ReplicationLag uint64
|
type ReplicationLag uint64
|
||||||
|
|
||||||
// UnmarshalJSON implements the json.Unmarshaller interface.
|
// UnmarshalJSON converts member lag (can be int or string) into uint64
|
||||||
func (pl *ReplicationLag) UnmarshalJSON(value []byte) error {
|
func (rl *ReplicationLag) UnmarshalJSON(data []byte) error {
|
||||||
var lagUInt64 uint64
|
var lagUInt64 uint64
|
||||||
if value[0] == '"' {
|
if data[0] == '"' {
|
||||||
*pl = math.MaxUint64
|
*rl = math.MaxUint64
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err := json.Unmarshal(value, &lagUInt64); err != nil {
|
if err := json.Unmarshal(data, &lagUInt64); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
*pl = ReplicationLag(lagUInt64)
|
*rl = ReplicationLag(lagUInt64)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue