forked from TrueCloudLab/frostfs-api-go
[#356] refs: Handle uint32 overflow in SubnetID
text format
Clarify the bit size limit in `SubnetID.UnmarshalText` method. Cover overflow case in unit test. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
4560e447e1
commit
dc292864aa
2 changed files with 13 additions and 1 deletions
|
@ -199,7 +199,9 @@ func (s *SubnetID) MarshalText() ([]byte, error) {
|
|||
}
|
||||
|
||||
// UnmarshalText decodes SubnetID from the text according to NeoFS API V2 protocol:
|
||||
// should be base-10 integer string format.
|
||||
// should be base-10 integer string format with bitsize = 32.
|
||||
//
|
||||
// Returns strconv.ErrRange if integer overflows uint32.
|
||||
//
|
||||
// Must not be called on nil.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue