The "syntax error: unexpected semicolon or newline" error occurs because the shell is interpreting a semicolon or newline in your command incorrectly, often due to missing quotes or incorrect syntax in a script. Ensure your command is properly quoted or that you are not accidentally including a semicolon where a newline is expected. For example, if you are running a command with arguments containing special characters, wrap the entire command in quotes:
export GODEBUG="tarinsecurepath=0"
If the error persists, check for hidden characters or incorrect line endings in your script file.