Software developers spend a lot of time debugging applications. The time spent often times is more than developing or adding a new feature. This reduces the productivity of software developers.
In this section two debugging approaches for the operator services will be introduced, Debugging with VS Code and Debugging with Delve. The former approach is useful for developers who uses Visual Studio Code as their main IDE, meanwhile the latter approach is suitable for server debugging with command lines for experienced Linux user.
launch.json
is not yet configured, click create a launch.json file and select Go: Launch Package.
.vscode/launch.json
. Change the program
value to cmd
.env
object field and fill it with the required environment variables.{ "version": "0.2.0", "configurations": [ { "name": "Launch Package", "type": "go", "request": "launch", "mode": "auto", "program": "cmd", "env": { "PORT": "8080", "OPERATOR_CODE": "dev", "GOOGLE_PROJECT_ID":"provider-serverless" } } ]
Start Debugging
button.Follow the instructions in Visual Studio Code Documentation on Debugging for further debugging guide.
Follow the instructions in Delve Github Repository