fix int64 attr

This commit is contained in:
Ben Johnson 2016-02-17 10:59:17 -07:00
parent 4394a97db8
commit b68c1caea0
3 changed files with 9 additions and 3 deletions

View file

@ -108,8 +108,14 @@ func (s *AttrStore) SetAttrs(id uint64, m map[string]interface{}) error {
for k, v := range m {
if v == nil {
delete(attr, k)
} else {
continue
}
switch v := v.(type) {
case string, uint64, bool:
attr[k] = v
default:
return fmt.Errorf("invalid attr type: %T", v)
}
}

View file

@ -28,7 +28,7 @@ message Profile {
message Attr {
required string Key = 1;
optional string StringValue = 2;
optional uint64 UintValue = 3;
optional uint64 UintValue = 3;
optional bool BoolValue = 4;
}

View file

@ -390,7 +390,7 @@ func (p *Parser) parseSetBitmapAttrsCall() (*SetBitmapAttrs, error) {
case string, bool:
c.Attrs[key] = v
case uint64:
c.Attrs[key] = int64(v)
c.Attrs[key] = v
default:
return nil, parseErrorf(pos, "invalid SetBitmapAttrs() arg: %v", arg.key)
}