Debugging your first local WebSocket server
Debugging a web application is one of the most important skills for a developer to learn, as it helps in identifying a problem, isolating the source of the problem, and then either correcting the problem or determining a way to work around it. In this recipe, we will learn how to debug a WebSocket server running locally using GoLand IDE.
Getting ready…
This recipe assumes you have GoLand IDE installed and configured to run the Go Application on your machine.
How to do it…
- Click
Open Project
in the GoLand IDE to openwebsocket-server.go
, which we wrote in our previous recipe, as shown in the following screenshot:

- Once the project opens, click on
Edit Configurations
asshownin the following screenshot:

- Select
Add New Configuration
by clicking the+
sign as shown in the following screenshot:

- Select
Go Build
, rename theconfigurationtoWebSocket Local Debug
, changeRun kind
toDirectory
, and click onApply
andOK
as shown in the following screenshot:

- Place a few breakpoints...