mirror of
https://github.com/bluenviron/mediamtx.git
synced 2026-01-26 21:39:16 -08:00
switch to reflect.Pointer (#5377)
This commit is contained in:
parent
719ca2ae39
commit
1a53e40bdc
8 changed files with 8 additions and 8 deletions
|
|
@ -20,7 +20,7 @@ import (
|
|||
)
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
func sortedKeys(paths map[string]*conf.Path) []string {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ func copyStructFields(dest any, source any) {
|
|||
|
||||
if fnew.Kind() == reflect.Pointer {
|
||||
if !fnew.IsNil() {
|
||||
if f.Kind() == reflect.Ptr {
|
||||
if f.Kind() == reflect.Pointer {
|
||||
f.Set(fnew)
|
||||
} else {
|
||||
f.Set(fnew.Elem())
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import (
|
|||
)
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
func sortedKeys(paths map[string]string) []string {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
var ErrMuxerNotFound = errors.New("muxer not found")
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
type serverGetMuxerRes struct {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
var ErrConnNotFound = errors.New("connection not found")
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
type serverAPIConnsListRes struct {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ var ErrConnNotFound = errors.New("connection not found")
|
|||
var ErrSessionNotFound = errors.New("session not found")
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
func printAddresses(srv *gortsplib.Server) string {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
var ErrConnNotFound = errors.New("connection not found")
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
func srtMaxPayloadSize(u int) int {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const (
|
|||
var ErrSessionNotFound = errors.New("session not found")
|
||||
|
||||
func interfaceIsEmpty(i any) bool {
|
||||
return reflect.ValueOf(i).Kind() != reflect.Ptr || reflect.ValueOf(i).IsNil()
|
||||
return reflect.ValueOf(i).Kind() != reflect.Pointer || reflect.ValueOf(i).IsNil()
|
||||
}
|
||||
|
||||
type nilWriter struct{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue