1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-24 22:53:52 +02:00

сделал FillMessageTelegramFromMessage()

This commit is contained in:
Nikitin Aleksandr
2024-06-19 13:58:01 +03:00
parent c6d5b65f88
commit b2cd7c773a
4 changed files with 186 additions and 1 deletions

View File

@@ -931,3 +931,18 @@ func SortMapStringInt_Desc(values map[string]int) []string {
}
return ranked
}
// IsNilInterface - проверка интерфейса на nil
func IsNilInterface(i any) bool {
iv := reflect.ValueOf(i)
if !iv.IsValid() {
return true
}
switch iv.Kind() {
case reflect.Ptr, reflect.Slice, reflect.Map, reflect.Func, reflect.Interface:
return iv.IsNil()
default:
return false
}
}