Update module github.com/containers/common to v0.51.0

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-01-24 16:22:22 +00:00
committed by Miloslav Trmač
parent fe15a36ed9
commit afbdaf8ecb
9 changed files with 183 additions and 201 deletions

View File

@@ -1,13 +1,18 @@
package report
import "regexp"
import (
"github.com/containers/storage/pkg/regexp"
)
var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*(\.)?\s*}})\s*$`)
// 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*$`)
// JSONFormat test CLI --format string to be a JSON request
// if report.IsJSON(cmd.Flag("format").Value.String()) {
// ... process JSON and output
// }
//
// if report.IsJSON(cmd.Flag("format").Value.String()) {
// ... process JSON and output
// }
func IsJSON(s string) bool {
return jsonRegex.MatchString(s)
}