cli/command/formatter: export JSONFormat const

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1aaa179d9d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-10 14:26:07 +02:00
parent ced769fc12
commit 99124087e0
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ const (
JSONFormatKey = "json"
DefaultQuietFormat = "{{.ID}}"
jsonFormat = "{{json .}}"
JSONFormat = "{{json .}}"
)
// Format is the format string rendered using the Context
@ -62,7 +62,7 @@ func (c *Context) preFormat() {
case c.Format.IsTable():
c.finalFormat = c.finalFormat[len(TableFormatKey):]
case c.Format.IsJSON():
c.finalFormat = jsonFormat
c.finalFormat = JSONFormat
}
c.finalFormat = strings.Trim(c.finalFormat, " ")