Panic: runtime error: invalid memory address or nil pointer dereference

Hello everyone. I’m new to badger. I’m trying to implement bucket by adding a fixed size prefix to the key value. Everything is going great so far except that I keep getting a crash from badger at some point in the application. The crash didn’t come directly from me. It seem to be happening in a goroutine in badger. Below is the stack trace. https://bpaste.net/show/adecd34b573c
Thanks.

Looks like an iterator closing is causing issue, but this might be an issue with how you’re using Badger.

Can you copy paste the code where you’re seeing the stack trace coming from?

I’ve been able to solve it. I don’t know what was wrong but I rewrote the entire code. Can a feature be added where you can have more than one iterator, discarding transactions automatically closes the iterator associated with it and delete an item from an iterator?

Maybe. You can file an issue in Badger, and we’ll consider if the benefits outweight the additional logic required.