You don't need the end slice here, it's always the same as the length of `buf` itself as far as I can tell