diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-22 05:54:49 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-23 14:12:37 -0400 |
commit | 54653ceebeabaf30e89d69e0f5aa5de431cc6bd7 (patch) | |
tree | 34efe49d86e9ba64c3a9ef7b2bdb22cb9cc3d37e /vendor/github.com/google/go-cmp/cmp/report_reflect.go | |
parent | 25dc2759e10bf0293f14a2205291ab7dd53eccf4 (diff) | |
download | podman-54653ceebeabaf30e89d69e0f5aa5de431cc6bd7.tar.gz podman-54653ceebeabaf30e89d69e0f5aa5de431cc6bd7.tar.bz2 podman-54653ceebeabaf30e89d69e0f5aa5de431cc6bd7.zip |
Update vendor or containers/buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/google/go-cmp/cmp/report_reflect.go')
-rw-r--r-- | vendor/github.com/google/go-cmp/cmp/report_reflect.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 287b89358..2ab41fad3 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -16,6 +16,13 @@ import ( "github.com/google/go-cmp/cmp/internal/value" ) +var ( + anyType = reflect.TypeOf((*interface{})(nil)).Elem() + stringType = reflect.TypeOf((*string)(nil)).Elem() + bytesType = reflect.TypeOf((*[]byte)(nil)).Elem() + byteType = reflect.TypeOf((*byte)(nil)).Elem() +) + type formatValueOptions struct { // AvoidStringer controls whether to avoid calling custom stringer // methods like error.Error or fmt.Stringer.String. @@ -184,7 +191,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } for i := 0; i < v.NumField(); i++ { vv := v.Field(i) - if value.IsZero(vv) { + if vv.IsZero() { continue // Elide fields with zero values } if len(list) == maxLen { @@ -205,7 +212,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } // Check whether this is a []byte of text data. - if t.Elem() == reflect.TypeOf(byte(0)) { + if t.Elem() == byteType { b := v.Bytes() isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) || unicode.IsSpace(r) } if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { |