配列の分割

func sliceIDs(ids []string, n int) (output [][]string) {
    for i := 0; i < (len(ids)/n)+1; i++ {
        fromIndex := i * n
        toIndex := fromIndex + n
        if toIndex > len(ids) {
            toIndex = len(ids)
        }
        output = append(output, ids[fromIndex:toIndex])
    }
    return
}