(buf []byte, lim int)
| 66 | } |
| 67 | |
| 68 | func chunk_buffer(buf []byte, lim int) [][]byte { |
| 69 | var chunk []byte |
| 70 | chunks := make([][]byte, 0, len(buf)/lim+1) |
| 71 | for len(buf) >= lim { |
| 72 | chunk, buf = buf[:lim], buf[lim:] |
| 73 | chunks = append(chunks, chunk) |
| 74 | } |
| 75 | if len(buf) > 0 { |
| 76 | chunks = append(chunks, buf[:len(buf)]) |
| 77 | } |
| 78 | return chunks |
| 79 | } |
| 80 | |
| 81 | func main() { |
| 82 | //auth bot |