Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 73 for nelem (0.04 sec)

  1. src/errors/wrap_test.go

    		rtarget := reflect.ValueOf(tc.target)
    		rtarget.Elem().Set(reflect.Zero(reflect.TypeOf(tc.target).Elem()))
    		t.Run(name, func(t *testing.T) {
    			match := errors.As(tc.err, tc.target)
    			if match != tc.match {
    				t.Fatalf("match: got %v; want %v", match, tc.match)
    			}
    			if !match {
    				return
    			}
    			if got := rtarget.Elem().Interface(); got != tc.want {
    				t.Fatalf("got %#v, want %#v", got, tc.want)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:49:49 UTC 2024
    - 6K bytes
    - Viewed (0)
  2. schema/serializer.go

    			return fmt.Errorf("failed to unmarshal JSONB value: %#v", dbValue)
    		}
    
    		if len(bytes) > 0 {
    			err = json.Unmarshal(bytes, fieldValue.Interface())
    		}
    	}
    
    	field.ReflectValueOf(ctx, dst).Set(fieldValue.Elem())
    	return
    }
    
    // Value implements serializer interface
    func (JSONSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 08:28:46 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/named_test.go

    		t.Fatal(err)
    	}
    
    	firstFieldType := func(n *Named) *Named {
    		return n.Underlying().(*Struct).Field(0).Type().(*Pointer).Elem().(*Named)
    	}
    
    	Inst := Unalias(pkg.Scope().Lookup("Inst").Type()).(*Pointer).Elem().(*Named)
    	Node := firstFieldType(Inst)
    	Tree := firstFieldType(Node)
    	if !Identical(Inst, Tree) {
    		t.Fatalf("Not a cycle: got %v, want %v", Tree, Inst)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 16 21:06:56 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. test/typeparam/graph.go

    // elements equal. All floating point NaNs are considered equal.
    func _SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testshared/testdata/depBase/dep.go

    	// This code below causes various go.itab.* symbols to be generated in
    	// the shared library. Similar code in ../exe/exe.go results in
    	// exercising https://golang.org/issues/17594
    	reflect.TypeOf(os.Stdout).Elem()
    	return 10
    }
    
    func F() int {
    	defer func() {}()
    	return V
    }
    
    func H() {
    	// Issue 67635: deadcoded closures causes linker crash.
    	func() { F() }()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 14:52:41 UTC 2024
    - 1K bytes
    - Viewed (0)
  6. pkg/config/analysis/local/helpers_test.go

    	Group:         "testdata.istio.io",
    	Kind:          "Kind1",
    	Plural:        "Kind1s",
    	Version:       "v1alpha1",
    	Proto:         "google.protobuf.Struct",
    	ReflectType:   reflect.TypeOf(&structpb.Struct{}).Elem(),
    	ProtoPackage:  "github.com/gogo/protobuf/types",
    	ClusterScoped: false,
    	ValidateProto: validation.EmptyValidate,
    }.MustBuild()
    
    func createTestResource(t *testing.T, ns, name, version string) *resource.Instance {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 02 17:36:47 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. pkg/typemap/map.go

    type TypeMap struct {
    	inner map[reflect.Type]any
    }
    
    func NewTypeMap() TypeMap {
    	return TypeMap{make(map[reflect.Type]any)}
    }
    
    func Set[T any](t TypeMap, v T) {
    	interfaceType := reflect.TypeOf((*T)(nil)).Elem()
    	t.inner[interfaceType] = v
    }
    
    func Get[T any](t TypeMap) *T {
    	v, f := t.inner[reflect.TypeFor[T]()]
    	if f {
    		return ptr.Of(v.(T))
    	}
    	return nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/roundtrip_test.go

    					err = modePair.dec.Unmarshal(cborFromOriginal, final.Interface())
    					if err != nil {
    						t.Fatalf("unexpected error from Unmarshal into %T: %v", final.Interface(), err)
    					}
    					if diff := cmp.Diff(original, final.Elem().Interface()); diff != "" {
    						t.Errorf("unexpected difference on roundtrip from original to original:\n%s", diff)
    					}
    				}
    
    				{
    					// original to interface{} to original
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 21:48:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/typesinternal/types.go

    // yet exported.
    package typesinternal
    
    import (
    	"go/token"
    	"go/types"
    	"reflect"
    	"unsafe"
    )
    
    func SetUsesCgo(conf *types.Config) bool {
    	v := reflect.ValueOf(conf).Elem()
    
    	f := v.FieldByName("go115UsesCgo")
    	if !f.IsValid() {
    		f = v.FieldByName("UsesCgo")
    		if !f.IsValid() {
    			return false
    		}
    	}
    
    	addr := unsafe.Pointer(f.UnsafeAddr())
    	*(*bool)(addr) = true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/gcsizes.go

    	switch t := under(T).(type) {
    	case *Array:
    		// spec: "For a variable x of array type: unsafe.Alignof(x)
    		// is the same as unsafe.Alignof(x[0]), but at least 1."
    		return s.Alignof(t.elem)
    	case *Struct:
    		if len(t.fields) == 0 && IsSyncAtomicAlign64(T) {
    			// Special case: sync/atomic.align64 is an
    			// empty struct we recognize as a signal that
    			// the struct it contains must be
    			// 64-bit-aligned.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top