Why doesn't Debug in Goland?

Here's the code I have

package main

import (

var DB map[string]string

func main() {

 stopchan := make(chan os.Signal)

 router := chi.NewRouter()

 router.Route("/", func(r chi.Router) {
 r.Get("/", GetIndexHandler)
 r.Post("/", GetPostIndexHandler)

 go func() {
 err := http.ListenAndServe(":8080", router)

 signal.Notify(stopchan, os.Kill, os.Interrupt)


GetIndexHandler func(w http.ResponseWriter, r *http.Request) {
 key := chi.URLParam(r, "key")
 value, exists := DB[key]

 if exists {
 } else {

GetPostIndexHandler func(w http.ResponseWriter, r *http.Request) {
 key := chi.URLParam(r, "key")
 value := chi.URLParam(r, "value")
 DB[key] = value

I want to make a stop at the time the post request to the server. Add a stop in the appropriate place:
Launch Run -> Debug

Shows like this:

Strictly speaking, I never used this, and just output values to the console. But now for the first time needed and it is not clear how to set. Can I to do something in this situation to make the breakpoint and I could see the current values of variables? Thank you for your answer.
April 7th 20 at 11:22
1 answer
April 7th 20 at 11:24
Because your app crashes at startup. And even the error that port 8080 is busy.
thank you, got sidetracked, will try in the near future to deal - Emma63 commented on April 7th 20 at 11:27

Find more questions by tags GoGoLand