'VS Code: Remote Debugging with Local Files (Go)

I have a remote machine that has physical hardware attached that my Go code interfaces with. The code must be run on this remote machine for it to work.

I'm using VS Code on a separate machine. I'd like to keep the code files local (on the development machine), as it has all of the version control and such set up properly, but run the Go debugger on the remote machine. Is there a way to accomplish this?

I know VS Code supports remote development over SSH, but it requires the source code files to also be on the remote machine.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source