- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for ValuesAreSameType (0.23 sec)
-
operator/pkg/util/reflect.go
if v.IsNil() { return false } v = v.Elem() } return !IsValueStruct(v) && !IsValueMap(v) && !IsValueSlice(v) } // ValuesAreSameType returns true if v1 and v2 has the same reflect.Type, // otherwise it returns false. func ValuesAreSameType(v1 reflect.Value, v2 reflect.Value) bool { return v1.Type() == v2.Type() } // IsEmptyString returns true if value is an empty string.
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 8.6K bytes - Viewed (0) -
operator/pkg/util/reflect_test.go
inDesc: "fail EnumType and int64 types", inV1: EnumType(42), inV2: int64(43), want: false, }, } for _, tt := range tests { t.Run(tt.inDesc, func(t *testing.T) { got := ValuesAreSameType(reflect.ValueOf(tt.inV1), reflect.ValueOf(tt.inV2)) if got != tt.want { t.Errorf("got %v, want %v for comparing %T against %T", got, tt.want, tt.inV1, tt.inV2) } }) } }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 10.2K bytes - Viewed (0)