-
You have access to OpenShift Web Console URL. Ask your workshop coordinator for URL if you don’t have one.
-
You have credentials to login. Ask your workshop coordinator for credentials to log onto the OpenShift cluster
-
You have access to a CodeReady Workspaces URL. Ask your workshop coordinator for URL if you don’t have one.
-
Completed Using CodeReady Workspaces build containerized application in a container
CodeReady Workspaces 2.0 provides developer environments that are Kubernetes pods running on OpenShift. In those sandboxes are the components and tools needed to code on a project: a browser-based editor, the plugins, the tools, and the different runtimes required for your project. Everything is running in containers, providing highly consistent, repeatable, and reproducible developer environments—zero config needed, zero pain.
-
Using the application deployed in Excerise [5.whatever$] we will debug and then deploy the application to OpenShift
Click on the debug icon on the right hand of the screen.
Click on No Configuration
then select Add Configuration
.
Paste the following in the launch.json file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "/projects/src/github.com/golang/example/main.go"
}
]
}
Navigate back to Explorer
and select the main.go
file
-
In Main.go navigate to line 19
-
Click next to 19 to add line to debug
Navigate back to debug window click the play icon to start debugging
View the results of the debug step thru as needed
Click on the stop icon to stop debugging