etcdserver: internal request union

This commit is contained in:
Xiang Li
2015-04-15 10:58:56 -07:00
parent 487639b2d8
commit 58503817ec
5 changed files with 180 additions and 8 deletions

View File

@@ -42,6 +42,13 @@ func MustUnmarshal(um Unmarshaler, data []byte) {
}
}
func MaybeUnmarshal(um Unmarshaler, data []byte) bool {
if err := um.Unmarshal(data); err != nil {
return false
}
return true
}
func GetBool(v *bool) (vv bool, set bool) {
if v == nil {
return false, false