Can you sense check the purpose of the errGlobal return together with the quit variable?
From my perspective errGlobal will always have a value when quit is true, and be nil otherwise. Also, the check if errGlobal != nil at the start of the for loop is also strange. That should only be possible if the loop was somehow asynch, or the errGlobal variable is somehow shared outside of the context of the function?
Can you sense check the purpose of the errGlobal return together with the quit variable?
From my perspective errGlobal will always have a value when quit is true, and be nil otherwise. Also, the check if errGlobal != nil at the start of the for loop is also strange. That should only be possible if the loop was somehow asynch, or the errGlobal variable is somehow shared outside of the context of the function?