Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,307 for REFLECT (0.12 sec)

  1. src/reflect/nih_test.go

    		t.Fatalf("got %d, want 7", got)
    	}
    
    	v = ValueOf((*nih)(unsafe.Pointer(new(int))))
    	shouldPanic("reflect: reflect.Value.Elem on an invalid notinheap pointer", func() { v.Elem() })
    	shouldPanic("reflect: reflect.Value.Pointer on an invalid notinheap pointer", func() { v.Pointer() })
    	shouldPanic("reflect: reflect.Value.UnsafePointer on an invalid notinheap pointer", func() { v.UnsafePointer() })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 01:16:54 UTC 2022
    - 1004 bytes
    - Viewed (0)
  2. src/internal/fmtsort/sort.go

    func compare(aVal, bVal reflect.Value) int {
    	aType, bType := aVal.Type(), bVal.Type()
    	if aType != bType {
    		return -1 // No good answer possible, but don't return 0: they're not equal.
    	}
    	switch aVal.Kind() {
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		return cmp.Compare(aVal.Int(), bVal.Int())
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:31:45 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  3. src/cmd/link/internal/ld/testdata/deadcode/structof_funcof.go

    			Type: reflect.TypeOf(int(0)),
    		},
    	})
    	println(t.Name())
    }
    
    func useFuncOf() {
    	t := reflect.FuncOf(
    		[]reflect.Type{reflect.TypeOf(int(0))},
    		[]reflect.Type{reflect.TypeOf(int(0))},
    		false,
    	)
    	println(t.Name())
    }
    
    func main() {
    	useStructOf()
    	useFuncOf()
    
    	var t T
    	meth, _ := reflect.TypeOf(t).MethodByName("F")
    	ft := meth.Type
    	at := ft.In(1)
    	v := reflect.New(at).Elem()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:07:26 UTC 2023
    - 994 bytes
    - Viewed (0)
  4. test/fixedbugs/issue25897a.go

    		// wrapper closure for the "go" statement.
    		f := reflect.MakeFunc(reflect.TypeOf(((func(*int))(nil))),
    			func(args []reflect.Value) []reflect.Value {
    				c <- true
    				return nil
    			}).Interface().(func(*int))
    		go f(nil)
    
    		g := reflect.MakeFunc(reflect.TypeOf(((func())(nil))),
    			func(args []reflect.Value) []reflect.Value {
    				c <- true
    				return nil
    			}).Interface().(func())
    		go g()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 19:04:48 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  5. src/database/sql/driver/types.go

    		}
    		return b, nil
    	}
    
    	sv := reflect.ValueOf(src)
    	switch sv.Kind() {
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		iv := sv.Int()
    		if iv == 1 || iv == 0 {
    			return iv == 1, nil
    		}
    		return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", iv)
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
    		uv := sv.Uint()
    		if uv == 1 || uv == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 16:30:20 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  6. src/go/ast/print.go

    	"fmt"
    	"go/token"
    	"io"
    	"os"
    	"reflect"
    )
    
    // A FieldFilter may be provided to [Fprint] to control the output.
    type FieldFilter func(name string, value reflect.Value) bool
    
    // NotNilFilter is a [FieldFilter] that returns true for field values
    // that are not nil; it returns false otherwise.
    func NotNilFilter(_ string, v reflect.Value) bool {
    	switch v.Kind() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  7. schema/serializer.go

    	switch v := fieldValue.(type) {
    	case int64, int, uint, uint64, int32, uint32, int16, uint16:
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	case *int64, *int, *uint, *uint64, *int32, *uint32, *int16, *uint16:
    		if rv.IsZero() {
    			return nil, nil
    		}
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	default:
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 08:28:46 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  8. src/cmd/cgo/internal/testshared/testdata/exe/exe.go

    	// exercising https://golang.org/issues/17594
    	reflect.TypeOf(os.Stdout).Elem()
    	runtime.GC()
    	depBase.V = depBase.F() + 1
    
    	var c *C
    	if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) {
    		panic("bad reflection results, see golang.org/issue/18252")
    	}
    
    	sp := reflect.New(reflect.TypeOf(slicePtr).Elem())
    	s := sp.Interface()
    
    	if reflect.TypeOf(s) != reflect.TypeOf(slicePtr) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 906 bytes
    - Viewed (0)
  9. src/internal/types/testdata/check/importdecl0/importdecl0a.go

    	_ "math/big"
    )
    
    import "fmt"
    import f1 "fmt"
    import f2 "fmt"
    
    // reflect.flag must not be visible in this package
    type flag int
    type _ reflect.flag /* ERROR "name flag not exported by package reflect" */
    
    // imported package name may conflict with local objects
    type reflect /* ERROR "reflect already declared" */ int
    
    // dot-imported exported objects may conflict with local objects
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  10. src/encoding/gob/encoder.go

    	}
    	// Now send the inner types
    	switch st := actual; st.Kind() {
    	case reflect.Struct:
    		for i := 0; i < st.NumField(); i++ {
    			if isExported(st.Field(i).Name) {
    				enc.sendType(w, state, st.Field(i).Type)
    			}
    		}
    	case reflect.Array, reflect.Slice:
    		enc.sendType(w, state, st.Elem())
    	case reflect.Map:
    		enc.sendType(w, state, st.Key())
    		enc.sendType(w, state, st.Elem())
    	}
    	return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 7.8K bytes
    - Viewed (0)
Back to top