← history for internal/rest/outputs.go
3e450aedinternal/rest/outputs.go15 lines⬡ raw↓ download
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
package rest

import (
    "yats/internal/config"

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

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)
    }
}