- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 1,466 for REFLECT (0.12 sec)
-
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) -
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) -
staging/src/k8s.io/apimachinery/pkg/api/apitesting/naming/naming.go
switch tp.Kind() { case reflect.Map, reflect.Slice, reflect.Pointer: errs = append(errs, ensureTags(gvk, tp.Elem(), parents, allowedNonstandardJSONNames)...) case reflect.String, reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Interface: // no-op case reflect.Struct: for i := 0; i < tp.NumField(); i++ {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jul 27 07:07:03 UTC 2022 - 5.8K bytes - Viewed (0) -
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) -
operator/pkg/tpath/struct.go
// Special case: map out type must be set through map ptr. if util.IsMap(val) && util.IsMapPtr(out) { reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val)) return nil } if util.IsSlice(val) && util.IsSlicePtr(out) { reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val)) return nil } if reflect.TypeOf(val) != reflect.TypeOf(out) { return fmt.Errorf("setFromPath from type %T != to type %T, %v", val, out, util.IsSlicePtr(out))
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 4.4K bytes - Viewed (0) -
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) -
staging/src/k8s.io/apimachinery/pkg/conversion/helper.go
package conversion import ( "fmt" "reflect" ) // EnforcePtr ensures that obj is a pointer of some sort. Returns a reflect.Value // of the dereferenced pointer, ensuring that it is settable/addressable. // Returns an error if this is not possible. func EnforcePtr(obj interface{}) (reflect.Value, error) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Pointer { if v.Kind() == reflect.Invalid {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Jun 25 16:23:43 UTC 2022 - 1.2K bytes - Viewed (0) -
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) -
pkg/kubelet/apis/config/register_test.go
AddToScheme: AddToScheme, AllowedTags: map[reflect.Type]bool{ reflect.TypeOf(logsapi.LoggingConfiguration{}): true, reflect.TypeOf(tracingapi.TracingConfiguration{}): true, reflect.TypeOf(metav1.Duration{}): true, reflect.TypeOf(metav1.TypeMeta{}): true, reflect.TypeOf(v1.NodeConfigSource{}): true, reflect.TypeOf(v1.Taint{}): true, }, }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Aug 01 16:55:02 UTC 2022 - 1.6K bytes - Viewed (0) -
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)