filebuffer icon indicating copy to clipboard operation
filebuffer copied to clipboard

panic: runtime error: slice bounds out of range

Open xiejunshi opened this issue 6 years ago • 1 comments

image image

Why is this line giving an error

xiejunshi avatar Nov 29 '19 02:11 xiejunshi

@xiejunshi I'm afraid that without more context, I can't tell for sure. It looks like your buffer might be empty (no bytes) or something is wrong with the indexing. From what I can tell, our index is not the same length as the buffer, the index is actually lower so we are trying to get a sub slice and it's crashing for you on line 124, in f.Bytes()[:f.Index].

Could you maybe set a breakpoint and check the index and the number of bytes?

mattetti avatar Nov 29 '19 03:11 mattetti