mirror of
https://github.com/containers/skopeo.git
synced 2025-09-22 18:37:21 +00:00
Update module github.com/containers/common to v0.51.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
committed by
Miloslav Trmač
parent
fe15a36ed9
commit
afbdaf8ecb
15
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
15
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user