// partitionMapByte partitions a given map into partitions with a given size.
partitionMapByte partitions a given map into partitions with a given size.
// partitionMapByte partitions a given map into partitions with a given size .
func partitionMapByte(data map[string][]byte, size int) []map[string][]byte {
	if size >= len(data) {
		return []map[string][]byte{data}
	}
	partitions := make([]map[string][]byte, 0)
	currentP := make(map[string][]byte)
	for k, v := range data {
		if len(currentP) == size {
			partitions = append(partitions, currentP)
			currentP = make(map[string][]byte)
		}
		currentP[k] = v
	}
	if len(currentP) > 0 {
		partitions = append(partitions, currentP)
	}
	return partitions
}
func partitionMapByte ( data map [ string ] [ ] byte , size int ) [ ] map [ string ] [ ] byte { if size >= len ( data ) { return [ ] map [ string ] [ ] byte { data } } partitions := make ( [ ] map [ string ] [ ] byte , 0 ) currentP := make ( map [ string ] [ ] byte ) for k , v := range data { if len ( currentP ) == size { partitions = append ( partitions , currentP ) currentP = make ( map [ string ] [ ] byte ) } currentP [ k ] = v } if len ( currentP ) > 0 { partitions = append ( partitions , currentP ) } return partitions }
partitionMapByte partitions a given map into partitions with a given size.
partitionMapByte partitions a given map into partitions with a given size .