- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for mapfndel (0.13 sec)
-
src/reflect/set_test.go
// Test implicit conversions in MapIndex and SetMapIndex. { // direct m := make(map[int]int) mv := ValueOf(m) mv.SetMapIndex(ValueOf(1), ValueOf(2)) x, ok := m[1] if x != 2 { t.Errorf("#1 after SetMapIndex(1,2): %d, %t (map=%v)", x, ok, m) } if n := mv.MapIndex(ValueOf(1)).Interface().(int); n != 2 { t.Errorf("#1 MapIndex(1) = %d", n) } } { // convert interface key
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 07 13:56:11 UTC 2022 - 5.7K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/valuefuzz.go
} case reflect.Map: if obj.IsNil() { // TODO: set non-nil value } else { for _, k := range obj.MapKeys() { // map values are not addressable. We need a copy. v := obj.MapIndex(k) copy := reflect.New(v.Type()) copy.Elem().Set(v) valueFuzz(copy.Elem()) obj.SetMapIndex(k, copy.Elem()) } // TODO: set some new value }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Jun 25 16:23:43 UTC 2022 - 2.3K bytes - Viewed (0) -
src/reflect/benchmark_test.go
} for _, tt := range tests { b.Run(tt.label, func(b *testing.B) { b.Run("MapIndex", func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { for j := tt.keys.Len() - 1; j >= 0; j-- { tt.m.MapIndex(tt.keys.Index(j)) } } }) b.Run("SetMapIndex", func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Nov 19 17:09:03 UTC 2023 - 8.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/diff/diff.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Apr 12 15:45:31 UTC 2023 - 3.4K bytes - Viewed (0) -
operator/pkg/tpath/struct.go
var structElems reflect.Value switch kind { case reflect.Map: if path[0] == "" { return nil, false, fmt.Errorf("getFromStructPath path %s, empty map key value", path) } mapVal := val.MapIndex(reflect.ValueOf(path[0])) if !mapVal.IsValid() { return nil, false, fmt.Errorf("getFromStructPath path %s, path does not exist", path) } return getFromStructPath(mapVal.Interface(), path[1:]) case reflect.Slice:
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 4.4K bytes - Viewed (0) -
staging/src/k8s.io/cli-runtime/pkg/printers/jsonpath.go
} v = v.Index(int(x)) case reflect.Map: if !index.IsValid() { index = reflect.Zero(v.Type().Key()) } if !index.Type().AssignableTo(v.Type().Key()) { return false } if x := v.MapIndex(index); x.IsValid() { v = x } else { v = reflect.Zero(v.Type().Elem()) } default: return false } } if _, isNil := indirect(v); isNil { return false } return true }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Jun 25 16:23:43 UTC 2022 - 4.3K bytes - Viewed (0) -
src/reflect/deepequal.go
if v1.Len() != v2.Len() { return false } if v1.UnsafePointer() == v2.UnsafePointer() { return true } iter := v1.MapRange() for iter.Next() { val1 := iter.Value() val2 := v2.MapIndex(iter.Key()) if !val1.IsValid() || !val2.IsValid() || !deepValueEqual(val1, val2, visited) { return false } } return true case Func: if v1.IsNil() && v2.IsNil() { return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:30 UTC 2024 - 7.4K bytes - Viewed (0) -
src/cmd/compile/internal/types2/example_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 28 17:58:07 UTC 2023 - 7.1K bytes - Viewed (0) -
tests/fuzz/crd_roundtrip_fuzzer.go
} case reflect.Map: if e.IsNil() { return fmt.Errorf("field is nil") } for _, k := range e.MapKeys() { if e.IsNil() { return fmt.Errorf("field is nil") } err := checkForNil(e.MapIndex(k)) if err != nil { return err } } case reflect.Ptr: if e.IsNil() { return fmt.Errorf("field is nil") } err := checkForNil(e.Elem()) if err != nil {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Mar 01 01:34:15 UTC 2023 - 5.8K bytes - Viewed (0) -
src/go/ast/print.go
case reflect.Map: p.printf("%s (len = %d) {", x.Type(), x.Len()) if x.Len() > 0 { p.indent++ p.printf("\n") for _, key := range x.MapKeys() { p.print(key) p.printf(": ") p.print(x.MapIndex(key)) p.printf("\n") } p.indent-- } p.printf("}") case reflect.Pointer: p.printf("*") // type-checked ASTs may contain cycles - use ptrmap
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 5.9K bytes - Viewed (0)