Skip to content

Instantly share code, notes, and snippets.

@naeemaei
Last active October 13, 2023 16:23
Show Gist options
  • Save naeemaei/3f467e7b6dd2c993e68053637853ad6c to your computer and use it in GitHub Desktop.
Save naeemaei/3f467e7b6dd2c993e68053637853ad6c to your computer and use it in GitHub Desktop.
Golang gin health check handler
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
)
type HealthHandler struct {
}
func NewHealthHandler() *HealthHandler {
return &HealthHandler{}
}
func (h *HealthHandler) Health(c *gin.Context) {
c.JSON(http.StatusOK, "Working!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment