I read other questions about the "slice bounds of range" here in the stackoverflow, but none of them using the same context from this. Then, none of the answers helped me.
In my use case, the "golang's syntax" of substring using [] doesn't return an error variable. It launches a runtime error using the "panic" instruction. My goal is to avoid to reach on the "panic" instruction. I need to treat this error and provide messages that describe with more details the context around the moment where this error had occurred.
Obs: The content of the string variable which one I need to get the substring value is totally dynamic and the indexes that I have been using to get the substring value is equally calculated dynamically.