and the reason I'm trying to do it because strings.Trim(inputStr) was crashing with the similar error few lines below. Not sure how to reproduce this issue, because when I restart the process from the point when it died, it works and I don't see this issue again. Next time I restart process from beginning, 50/50 it is going to happen again (not at the same spot where it failed last time).
The text was updated successfully, but these errors were encountered:
Your string values look corrupt. That should be impossible in a pure Go program with no races. Have you run your program under the race detector? Are you creating the strings in unsafe ways? Does your program use cgo?
Yes, program pulls data and spread across 20 go routines for processing. Don't use cgo, but you are right, I started it with race detector and see a few. Will fix / re-test and update here results. Thank you for help.
@ianlancetaylor, as soon as races were fixed all issues with strings disappeared. It now makes sense why it happened, but tbh without your reply I wouldn't be able to resolve it as I wasn't even digging this way. Does it make sense to show a better error message (like in maps) or maybe make simple data types thread-safe?