Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 1,307 for REFLECT (0.1 sec)

  1. test/fixedbugs/issue57184.go

    package main
    
    import (
    	"log"
    	"reflect"
    	"sort"
    )
    
    func main() {
    	const length = 257
    	x := make([]int64, length)
    	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()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 09 21:38:33 UTC 2022
    - 851 bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/testsanitizers/testdata/msan5.go

    	Go2(a);
    	if (a[0] != 42) {
    		abort();
    	}
    }
    */
    import "C"
    
    import (
    	"reflect"
    	"unsafe"
    )
    
    //export Go1
    func Go1(p *C.int) {
    	reflect.ValueOf(p).Elem().Set(reflect.ValueOf(C.int(42)))
    }
    
    //export Go2
    func Go2(p *C.char) {
    	a := (*[2]byte)(unsafe.Pointer(p))
    	reflect.Copy(reflect.ValueOf(a[:1]), reflect.ValueOf(a[1:]))
    }
    
    func main() {
    	C.C1()
    	C.C2()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 904 bytes
    - Viewed (0)
  3. callbacks/callmethod.go

    package callbacks
    
    import (
    	"reflect"
    
    	"gorm.io/gorm"
    )
    
    func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) {
    	tx := db.Session(&gorm.Session{NewDB: true})
    	if called := fc(db.Statement.ReflectValue.Interface(), tx); !called {
    		switch db.Statement.ReflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			db.Statement.CurDestIndex = 0
    			for i := 0; i < db.Statement.ReflectValue.Len(); i++ {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Feb 18 01:20:29 UTC 2023
    - 846 bytes
    - Viewed (0)
  4. platforms/core-configuration/kotlin-dsl/src/test/kotlin/org/gradle/kotlin/dsl/provider/ScriptApiTest.kt

    import org.junit.Test
    import kotlin.reflect.KCallable
    import kotlin.reflect.KClass
    import kotlin.reflect.KFunction
    import kotlin.reflect.KMutableProperty
    import kotlin.reflect.KParameter
    import kotlin.reflect.KProperty
    import kotlin.reflect.KType
    import kotlin.reflect.KTypeProjection
    import kotlin.reflect.KVariance
    import kotlin.reflect.KVisibility
    import kotlin.reflect.full.createType
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 08:06:49 UTC 2023
    - 9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/authorization/cel/compile_test.go

    	return nil
    }
    
    func nativeTypeToCELType(t *testing.T, nativeType reflect.Type, field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType {
    	switch nativeType {
    	case reflect.TypeOf(""):
    		return apiservercel.StringType
    	case reflect.TypeOf([]string{}):
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/meta.go

    	t := elemPatchMetaFromStruct.T
    
    	var elemType reflect.Type
    	switch t.Kind() {
    	// If t is an array or a slice, get the element type.
    	// If element is still an array or a slice, return an error.
    	// Otherwise, return element type.
    	case reflect.Array, reflect.Slice:
    		elemType = t.Elem()
    		if elemType.Kind() == reflect.Array || elemType.Kind() == reflect.Slice {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 16:45:45 UTC 2023
    - 7.7K bytes
    - Viewed (0)
  7. src/encoding/gob/type_test.go

    	newtyp := getTypeUnlocked("int", reflect.TypeFor[int]())
    	if newtyp != tInt.gobType() {
    		t.Errorf("reregistration of %s got new type", newtyp.string())
    	}
    	newtyp = getTypeUnlocked("uint", reflect.TypeFor[uint]())
    	if newtyp != tUint.gobType() {
    		t.Errorf("reregistration of %s got new type", newtyp.string())
    	}
    	newtyp = getTypeUnlocked("string", reflect.TypeFor[string]())
    	if newtyp != tString.gobType() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 01 14:26:13 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  8. platforms/core-configuration/declarative-dsl-core/src/main/kotlin/org/gradle/internal/declarativedsl/schemaBuilder/PropertyExtractor.kt

    import java.util.Locale
    import kotlin.reflect.KClass
    import kotlin.reflect.KFunction
    import kotlin.reflect.KMutableProperty
    import kotlin.reflect.KProperty
    import kotlin.reflect.KType
    import kotlin.reflect.KVisibility
    import kotlin.reflect.full.instanceParameter
    import kotlin.reflect.full.memberFunctions
    import kotlin.reflect.full.memberProperties
    import kotlin.reflect.full.primaryConstructor
    
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue May 14 10:08:01 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  9. tests/fuzz/crd_roundtrip_fuzzer.go

    // This part only converts the interface to a reflect.Value.
    func checkForNilValues(targetStruct any) error {
    	v := reflect.ValueOf(targetStruct)
    	e := v.Elem()
    	err := checkForNil(e)
    	if err != nil {
    		return err
    	}
    	return nil
    }
    
    // Checks for nil values in a reflect.Value.
    func checkForNil(e reflect.Value) error {
    	switch e.Kind() {
    	case reflect.Struct:
    		for i := 0; i < e.NumField(); i++ {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Mar 01 01:34:15 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  10. test/alias2.go

    // Test basic restrictions on type aliases.
    
    package p
    
    import (
    	"reflect"
    	. "reflect"
    )
    
    type T0 struct{}
    
    // Valid type alias declarations.
    
    type _ = T0
    type _ = int
    type _ = struct{}
    type _ = reflect.Value
    type _ = Value
    
    type (
    	A0 = T0
    	A1 = int
    	A2 = struct{}
    	A3 = reflect.Value
    	A4 = Value
    	A5 = Value
    
    	N0 A0
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 15:09:14 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top