// Take an array of meddra data and split it into 'lim' 2D array
Take an array of meddra data and split it into 'lim' 2D array
// Take an array of meddra data and split it into ' lim ' 2D array
func SplitQueries(buf []*Models.Drug, lim int) [][]*Models.Drug {
	var chunkSize = int(len(buf) / lim)
	chunks := make([][]*Models.Drug, 0, lim)
	for i := 0; i < lim; i++ {
		if i+1 == lim {
			chunks = append(chunks, buf[i*chunkSize:len(buf)])
		} else {
			chunks = append(chunks, buf[i*chunkSize:(i+1)*chunkSize])
		}
	}
	return chunks
}
func SplitQueries ( buf [ ] * Models . Drug , lim int ) [ ] [ ] * Models . Drug { var chunkSize = int ( len ( buf ) / lim ) chunks := make ( [ ] [ ] * Models . Drug , 0 , lim ) for i := 0 ; i < lim ; i ++ { if i + 1 == lim { chunks = append ( chunks , buf [ i * chunkSize : len ( buf ) ] ) } else { chunks = append ( chunks , buf [ i * chunkSize : ( i + 1 ) * chunkSize ] ) } } return chunks }
Take an array of meddra data and split it into 'lim' 2D array
Take an array of meddra data and split it into ' lim ' 2D array