mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-17 19:23:08 +02:00
renaming of variables and updating comment
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user