Search Options

Results per page
Sort
Preferred Languages
Advance

Results 211 - 220 of 987 for typeOf (0.15 sec)

  1. test/fixedbugs/issue52788.go

    import (
    	"fmt"
    	"reflect"
    )
    
    func f(next func() bool) {
    	for b := next(); b; b = next() {
    		fmt.Printf("next() returned %v\n", b)
    	}
    }
    
    func main() {
    	next := reflect.MakeFunc(reflect.TypeOf((func() bool)(nil)), func(_ []reflect.Value) []reflect.Value {
    		return []reflect.Value{reflect.ValueOf(false)}
    	})
    	reflect.ValueOf(f).Call([]reflect.Value{next})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 09 16:02:28 UTC 2022
    - 605 bytes
    - Viewed (0)
  2. test/reflectmethod7.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // See issue 44207.
    
    package main
    
    import "reflect"
    
    type S int
    
    func (s S) M() {}
    
    func main() {
    	t := reflect.TypeOf(S(0))
    	fn, ok := reflect.PointerTo(t).MethodByName("M")
    	if !ok {
    		panic("FAIL")
    	}
    	fn.Func.Call([]reflect.Value{reflect.New(t)})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 26 14:24:17 UTC 2021
    - 421 bytes
    - Viewed (0)
  3. test/typeparam/issue54456.go

    	// evaluate false.
    	if p == q {
    		panic("bad type identity")
    	}
    
    	for _, x := range []any{p, q} {
    		// The names here should not contain "·1" or "·2".
    		if name := reflect.TypeOf(x).String(); name != "main.T[int]" {
    			panic(name)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 18:13:48 UTC 2022
    - 898 bytes
    - Viewed (0)
  4. test/fixedbugs/issue57184.go

    	for i := 0; i < length; i++ {
    		x[i] = int64(i) * 27644437 % int64(length)
    	}
    
    	isLessStatic := func(i, j int) bool {
    		return x[i] < x[j]
    	}
    
    	isLessReflect := reflect.MakeFunc(reflect.TypeOf(isLessStatic), func(args []reflect.Value) []reflect.Value {
    		i := args[0].Int()
    		j := args[1].Int()
    		b := x[i] < x[j]
    		return []reflect.Value{reflect.ValueOf(b)}
    	}).Interface().(func(i, j int) bool)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 09 21:38:33 UTC 2022
    - 851 bytes
    - Viewed (0)
  5. src/main/webapp/js/admin/plugins/form-validator/sanitize.js

     *  @license MIT
     */
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Mon Jan 01 05:12:47 UTC 2018
    - 2.7K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/server/healthz/healthz_test.go

    			startedByInformerType: map[reflect.Type]bool{
    				reflect.TypeOf(corev1.Pod{}):     true,
    				reflect.TypeOf(corev1.Service{}): false,
    				reflect.TypeOf(corev1.Node{}):    true,
    			},
    		})
    
    		err := healthChecker.Check(nil)
    		if err == nil {
    			t.Errorf("expected error, got: %v", err)
    		}
    	})
    }
    
    type cacheSyncWaiterStub struct {
    	startedByInformerType map[reflect.Type]bool
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 15 20:43:16 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  7. operator/cmd/mesh/test-util_test.go

    	node := actual.(map[string]any)
    	got, f, err := tpath.GetPathContext(node, util.PathFromString(pv.path), false)
    	if err != nil || !f {
    		return false, err
    	}
    	if reflect.TypeOf(got.Node) != reflect.TypeOf(pv.value) {
    		return false, fmt.Errorf("comparison types don't match: got %v(%T), want %v(%T)", got.Node, got.Node, pv.value, pv.value)
    	}
    	if !reflect.DeepEqual(got.Node, pv.value) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  8. src/go/types/sizeof_test.go

    package types
    
    import (
    	"reflect"
    	"testing"
    )
    
    // Signal size changes of important structures.
    func TestSizeof(t *testing.T) {
    	const _64bit = ^uint(0)>>32 != 0
    
    	var tests = []struct {
    		val    any     // type as a value
    		_32bit uintptr // size on 32bit platforms
    		_64bit uintptr // size on 64bit platforms
    	}{
    		// Types
    		{Basic{}, 16, 32},
    		{Array{}, 16, 24},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 06 13:09:19 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  9. src/main/webapp/js/admin/plugins/form-validator/sepa.js

     *
     *  @version 2.3.77
     *  @website http://formvalidator.net/
     *  @author Victor Jonsson, http://victorjonsson.se
     *  @license MIT
     */
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Mon Jan 01 05:12:47 UTC 2018
    - 3.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types/sizeof_test.go

    		{Sym{}, 32, 64},
    		{Type{}, 64, 104},
    		{Map{}, 12, 24},
    		{Forward{}, 20, 32},
    		{Func{}, 32, 56},
    		{Struct{}, 12, 24},
    		{Interface{}, 0, 0},
    		{Chan{}, 8, 16},
    		{Array{}, 12, 16},
    		{FuncArgs{}, 4, 8},
    		{ChanArgs{}, 4, 8},
    		{Ptr{}, 4, 8},
    		{Slice{}, 4, 8},
    	}
    
    	for _, tt := range tests {
    		want := tt._32bit
    		if _64bit {
    			want = tt._64bit
    		}
    		got := reflect.TypeOf(tt.val).Size()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 18 17:08:44 UTC 2024
    - 1K bytes
    - Viewed (0)
Back to top