code: func (s *SparseRange) Normalize() error {
  	if len(s.Items) == 0 {
  		s.Items = []*RangeItem{{RangeItem: &RangeItem_Single{1}}}
  		return nil
  	}
  	current := uint32(0)
  	for _, itm := range s.Items {
  		switch i := itm.RangeItem.(type) {
  		case *RangeItem_Single:
  			if i.Single <= current {
  				return fmt.Errorf("malformed SparseRange")
  			}
  			current = i.Single
  		case *RangeItem_Range:
  			if err := i.Range.Normalize(); err != nil {
  				return err
  			}
  			if i.Range.Low <= current {
  				return fmt.Errorf("malformed SparseRange")
  			}
  			current = i.Range.High
  		default:
  			return fmt.Errorf("unknown SparseRange entry")
  		}
  	}
  	return nil
  }
docs: // Normalize checks SparseRange for errors and converts it to its normalized form.