yats.git

ref: 7a02e6e5c41d1addc2b3479fb0b678ea30d80fd6

server/rest/outputs.go


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

import (
	"github.com/gin-gonic/gin"
	"yats-server/config"
)

func JsonPrint(cfg config.Configuration, c *gin.Context, status int, h map[string]any) {
	if "true" == cfg.FormatOutput {
		c.IndentedJSON(status, h)
	} else {
		c.JSON(status, h)
	}
}