I spent a very long time trying to get VS Code debugger to work for golang projects. I reinstalled Go, Delve, and VS Code to ensure they were for ARM not X86. Turns out after several hours with ChatGPT, it suggested I reinstall XCode. I went throught the complete uninstall and reinstall of Xcode and now the debugger works! I assume Xcode tools were building for X86 even though I have an ARM mac.
Error debugserver: Mach-O 64-bit executable x86_64
Fix
Run the following commands:
bash Copy code sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install This should trigger a clean installation of the command-line tools.