Files
podman/vendor/go.podman.io/common/pkg/report/validate.go
Paul Holzinger dbfddb82cb vendor: update go.podman.io/{common,image,storage}
Update to the latest tags to make sure they all work correctly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-03 17:46:02 +02:00

19 lines
520 B
Go

package report
import (
"go.podman.io/storage/pkg/regexp"
)
// Check for json, {{json }} and {{ json. }} which are not valid go template,
// {{json .}} is valid and thus not matched to let the template handle it like docker does.
var jsonRegex = regexp.Delayed(`^\s*(json|{{\s*json\.?\s*}})\s*$`)
// IsJSON check if CLI --format string is a JSON request
//
// if report.IsJSON(cmd.Flag("format").Value.String()) {
// ... process JSON and output
// }
func IsJSON(s string) bool {
return jsonRegex.MatchString(s)
}