I’m trying to get a Gin application running and attached to a debugger in Atom.
Running go run main.go
or go build main.go && ./main
from the command line work fine, but using go-debug in Atom refuses to do anything. Every time I try to build or run it just throws an error and exits. I really really want to get this building and running in Atom.
I started with the basics:
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello from %v", "Gin")
})
r.Run(":3000")
}
And output:
Starting delve with ".../Projects/go/gin/main.go" with "debug"
couldn't start listener: listen tcp 127.0.0.1:2345: bind: address already in use
delve closed with code 1
Am I missing something?