1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

internal/server/helpers.go fix a bug in isVariant() where v.Elem() was called on non interface/pointer

This commit is contained in:
Henrik Hautakoski 2024-05-28 13:30:21 +02:00
parent 634205a546
commit ea5b2b8fc2

View file

@ -112,11 +112,10 @@ func isVariant(v reflect.Value) bool {
return false
}
if !isVariantName(v.Index(0).Elem().String()) {
return false
for v = v.Index(0); v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer; v = v.Elem() {
}
return true
return v.Kind() == reflect.String && isVariantName(v.String())
}
func parseTableDeltaData(v any) (map[string]interface{}, error) {