yats.git

ref: e5bd49de7ca22ce0eae54c5464e77e335ec508da

server/rest/outputs.go


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
package rest

import "github.com/gin-gonic/gin"

func JsonPrint(c *gin.Context, status int, h map[string]any) {
	formatted := false
	if formatted {
		c.IndentedJSON(status, h)
	} else {
		//c.JSON(status, h)
		c.String(status, "%v", h)
	}
}