Response

Report a typo

Write the additional required code to send a string with a success response using the http.StatusOK constant to the previously declared /user route.

package main

import (
    "github.com/gin-gonic/gin"
    "net/http"
)

func main() {
    router := gin.Default()
    router.GET("/user", userHandler)

    router.Run("127.0.0.1:8080")
}

func userHandler(context *gin.Context) {
    // your response here
}
Enter a short text
___

Create a free account to access the full topic