I am not able to troubleshoot this error. I have created my own slices and I dont seem to find any problems. I do have a runtime error in running it. I have even declared my
Use the playground to create a minimal example that recreates the problem, or post the minimal version here, using markdown formatting to mark it as code, or use a pastebin or similar services, but please no pics and not just dump everything…
And then the program was runnable on the playground:
I get the same error that your reported in your initial post:
panic: runtime error: index out of range [0]
The problem here is that your booking slice is empty (you can tell from the log message in the line above the panic: the whole slice: []) but you try to access the first element on line 40: