https://mattermost.atlassian.net/browse/MM-28737

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2020-10-25 22:09:55 +05:30
коммит произвёл GitHub
родитель d2730014f9
Коммит 087758caee
437 изменённых файлов: 18130 добавлений и 11371 удалений

7
vendor/github.com/gorilla/schema/encoder.go сгенерированный поставляемый
Просмотреть файл

@@ -57,6 +57,13 @@ func isZero(v reflect.Value) bool {
}
return z
case reflect.Struct:
type zero interface {
IsZero() bool
}
if v.Type().Implements(reflect.TypeOf((*zero)(nil)).Elem()) {
iz := v.MethodByName("IsZero").Call([]reflect.Value{})[0]
return iz.Interface().(bool)
}
z := true
for i := 0; i < v.NumField(); i++ {
z = z && isZero(v.Field(i))