fix: 修复 examples/httpc 中 c.String 非常量 format string 编译错误

This commit is contained in:
wjqserver 2026-04-22 08:51:42 +08:00
parent 7487369125
commit 390190695f

View file

@ -21,7 +21,7 @@ func main() {
c.JSON(http.StatusInternalServerError, touka.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, touka.H{"error": err.Error()})
return return
} }
c.String(http.StatusOK, body) c.String(http.StatusOK, "%s", body)
}) })
// 示例 2带 Header 的 POST 请求 // 示例 2带 Header 的 POST 请求
@ -90,7 +90,7 @@ func main() {
c.JSON(http.StatusInternalServerError, touka.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, touka.H{"error": err.Error()})
return return
} }
c.String(http.StatusOK, body) c.String(http.StatusOK, "%s", body)
}) })
fmt.Println("Server running on :8080") fmt.Println("Server running on :8080")