mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 21:30:16 +00:00 
			
		
		
		
	Updating dependency github.com/google/go-cmp to version v0.3.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
		
							
								
								
									
										4
									
								
								vendor/github.com/google/go-cmp/cmp/internal/value/sort.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/google/go-cmp/cmp/internal/value/sort.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -19,7 +19,7 @@ func SortKeys(vs []reflect.Value) []reflect.Value { | ||||
| 	} | ||||
|  | ||||
| 	// Sort the map keys. | ||||
| 	sort.Slice(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) | ||||
| 	sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) | ||||
|  | ||||
| 	// Deduplicate keys (fails for NaNs). | ||||
| 	vs2 := vs[:1] | ||||
| @@ -42,6 +42,8 @@ func isLess(x, y reflect.Value) bool { | ||||
| 	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: | ||||
| 		return x.Uint() < y.Uint() | ||||
| 	case reflect.Float32, reflect.Float64: | ||||
| 		// NOTE: This does not sort -0 as less than +0 | ||||
| 		// since Go maps treat -0 and +0 as equal keys. | ||||
| 		fx, fy := x.Float(), y.Float() | ||||
| 		return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy) | ||||
| 	case reflect.Complex64, reflect.Complex128: | ||||
|   | ||||
							
								
								
									
										9
									
								
								vendor/github.com/google/go-cmp/cmp/internal/value/zero.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/google/go-cmp/cmp/internal/value/zero.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,7 +4,10 @@ | ||||
|  | ||||
| package value | ||||
|  | ||||
| import "reflect" | ||||
| import ( | ||||
| 	"math" | ||||
| 	"reflect" | ||||
| ) | ||||
|  | ||||
| // IsZero reports whether v is the zero value. | ||||
| // This does not rely on Interface and so can be used on unexported fields. | ||||
| @@ -17,9 +20,9 @@ func IsZero(v reflect.Value) bool { | ||||
| 	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: | ||||
| 		return v.Uint() == 0 | ||||
| 	case reflect.Float32, reflect.Float64: | ||||
| 		return v.Float() == 0 | ||||
| 		return math.Float64bits(v.Float()) == 0 | ||||
| 	case reflect.Complex64, reflect.Complex128: | ||||
| 		return v.Complex() == 0 | ||||
| 		return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 | ||||
| 	case reflect.String: | ||||
| 		return v.String() == "" | ||||
| 	case reflect.UnsafePointer: | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/google/go-cmp/cmp/report_compare.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/google/go-cmp/cmp/report_compare.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -168,7 +168,7 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te | ||||
| 				var isZero bool | ||||
| 				switch opts.DiffMode { | ||||
| 				case diffIdentical: | ||||
| 					isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueX) | ||||
| 					isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) | ||||
| 				case diffRemoved: | ||||
| 					isZero = value.IsZero(r.Value.ValueX) | ||||
| 				case diffInserted: | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/google/go-cmp/cmp/report_reflect.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/google/go-cmp/cmp/report_reflect.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -208,7 +208,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t | ||||
| func formatMapKey(v reflect.Value) string { | ||||
| 	var opts formatOptions | ||||
| 	opts.TypeMode = elideType | ||||
| 	opts.AvoidStringer = true | ||||
| 	opts.ShallowPointers = true | ||||
| 	s := opts.FormatValue(v, visitedPointers{}).String() | ||||
| 	return strings.TrimSpace(s) | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/google/go-cmp/cmp/report_slices.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/google/go-cmp/cmp/report_slices.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -90,7 +90,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { | ||||
| 			} | ||||
| 			if r == '\n' { | ||||
| 				if maxLineLen < i-lastLineIdx { | ||||
| 					lastLineIdx = i - lastLineIdx | ||||
| 					maxLineLen = i - lastLineIdx | ||||
| 				} | ||||
| 				lastLineIdx = i + 1 | ||||
| 				numLines++ | ||||
| @@ -322,7 +322,7 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat | ||||
| 			hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0 | ||||
| 			hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0 | ||||
| 			if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize { | ||||
| 				*prev = (*prev).Append(*curr).Append(*next) | ||||
| 				*prev = prev.Append(*curr).Append(*next) | ||||
| 				groups = groups[:len(groups)-1] // Truncate off equal group | ||||
| 				continue | ||||
| 			} | ||||
|   | ||||
							
								
								
									
										7
									
								
								vendor/github.com/google/go-cmp/cmp/report_text.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/google/go-cmp/cmp/report_text.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -19,6 +19,11 @@ var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 | ||||
| type indentMode int | ||||
|  | ||||
| func (n indentMode) appendIndent(b []byte, d diffMode) []byte { | ||||
| 	// The output of Diff is documented as being unstable to provide future | ||||
| 	// flexibility in changing the output for more humanly readable reports. | ||||
| 	// This logic intentionally introduces instability to the exact output | ||||
| 	// so that users can detect accidental reliance on stability early on, | ||||
| 	// rather than much later when an actual change to the format occurs. | ||||
| 	if flags.Deterministic || randBool { | ||||
| 		// Use regular spaces (U+0020). | ||||
| 		switch d { | ||||
| @@ -360,7 +365,7 @@ func (s diffStats) String() string { | ||||
| 	// Pluralize the name (adjusting for some obscure English grammar rules). | ||||
| 	name := s.Name | ||||
| 	if sum > 1 { | ||||
| 		name = name + "s" | ||||
| 		name += "s" | ||||
| 		if strings.HasSuffix(name, "ys") { | ||||
| 			name = name[:len(name)-2] + "ies" // e.g., "entrys" => "entries" | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user