Unfortunately I don't know the true cause of this error. This sort of thing has been reported a few times in the past but I haven't seen a true resolution. Previously I had looked around the issue trackers without finding anything.
This appears to have something to do with Go. Go is only used for the arduino-builder tool so I think it's likely the problem is something related to arduino-builder.
The strange thing is that the same version of arduino-builder (1.3.25) is used by both Arduino IDE 1.8.2 and Arduino IDE 1.8.5.
I advise you to install Arduino IDE 1.8.2 again to verify that the problem only occurs with Arduino IDE 1.8.5. You can download the previous IDE releases from here:
If you can verify that the problem does occur in Arduino IDE 1.8.5 and does not occur in Arduino IDE 1.8.2, I think the next step in troubleshooting is to install Arduino IDE 1.8.3 and 1.8.4 so you can find the newest IDE version where the problem does not occur. That will narrow down the cause of the issue. Every bit of additional information is helpful when dealing with an issue like this. Even if we can't progress from there at least you will know which is the newest version of the IDE you can use.