I find the Gin documentation (and the examples provided by the project) to
be, ahem, lacking in important details. As you can see from the source (
https://github.com/gin-gonic/gin/blob/78dad9d77d8c2d679dedea1fbef5fc8a54372efd/gin.go#L372)
the Run() function returns an error that will tell you bind
Something is already running on localhost port 8080. use a different port.
On Tue, 27 Sept 2022 at 16:15, Conor O'Neill wrote:
> I am following a tutorial to great an API in Go with a framework called
> Gin.
>
> I have imported errors and created a function like so;
>
> func createBook(c *gin.Co
I am following a tutorial to great an API in Go with a framework called Gin.
I have imported errors and created a function like so;
func createBook(c *gin.Context) {
var newBook book
if err := c.BindJSON(&newBook); err != nil {
return
}
books = append(books, newBook)