From b63018c5a0c39c7ff51c20617cb4f5cd915aab24 Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 16 Feb 2024 21:27:27 +0800 Subject: [PATCH] Refactor ping endpoint to use WriteString method --- cmd/srv/controller/common_page.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/srv/controller/common_page.go b/cmd/srv/controller/common_page.go index c769675..8266477 100644 --- a/cmd/srv/controller/common_page.go +++ b/cmd/srv/controller/common_page.go @@ -22,7 +22,5 @@ func (p *commonPage) home(c *gin.Context) { } func (p *commonPage) ping(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{ - "message": "pong", - }) + c.Writer.WriteString("pong") }