code: func (renderer *renderer) Fieldsets(fields []Field) (f []fieldset, err error) {
  	if len(fields) > 0 {
  		for _, field := range fields {
  			cur := fieldset{}
  			cur.AmqpType, err = renderer.FieldType(field)
  			if err != nil {
  				return
  			}
  
  			cur.NativeType, err = renderer.NativeType(cur.AmqpType)
  			if err != nil {
  				return
  			}
  			cur.Fields = append(cur.Fields, field)
  			f = append(f, cur)
  		}
  
  		i, j := 0, 1
  		for j < len(f) {
  			if f[i].AmqpType == f[j].AmqpType {
  				f[i].Fields = append(f[i].Fields, f[j].Fields...)
  			} else {
  				i++
  				f[i] = f[j]
  			}
  			j++
  		}
  		return f[:i+1], nil
  	}
  
  	return
  }
docs: // Groups the fields so that the right encoder/decoder can be called