switch to reflect.Pointer (#5377)

This commit is contained in:
Alessandro Ros 2026-01-25 13:51:49 +01:00 committed by GitHub
parent 719ca2ae39
commit 1a53e40bdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 8 additions and 8 deletions

View file

@ -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 {

View file

@ -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())

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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{}