Stop a Remote Process After Debugging It
Clean-up processes after interacting with them in remote debugging scenarios.
Create a new Go Remote run configuration type via _Run | Edit Configurations... | + Go Remote. In the run configuration settings, in the On disconnect section, choose either Stop remote Delve process, Leave it running, or Ask to determine how the configuration behaves when you stop the debugger.