1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package needle import ( "strconv" ) type VolumeId uint32 func NewVolumeId(vid string) (VolumeId, error) { volumeId, err := strconv.ParseUint(vid, 10, 64) return VolumeId(volumeId), err } func (vid VolumeId) String() string { return strconv.FormatUint(uint64(vid), 10) } func (vid VolumeId) Next() VolumeId { return VolumeId(uint32(vid) + 1) }