yoheimuta/go-protoparser

Is possible that FieldNumber is not number?

Opened this issue · 1 comments

Why FieldNumber has string type? Can I expect strconv.AtoI always return nil error for FieldNumber?

@wirekang No, FieldNumber must be a number, according to the spec.

Practically, Go's int type can cover the sensible FieldNumber value.

However, each size limit is different. Let's say users give 170141183460469231731687303715884105727 as FieldNumber.
strconv.Atoi returns an error, but it's legit in Protocol Buffer.