mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
14 lines
302 B
Go
14 lines
302 B
Go
package persistence
|
|
|
|
import "reflect"
|
|
|
|
func collectField(collection interface{}, getValue func(item interface{}) string) []string {
|
|
s := reflect.ValueOf(collection)
|
|
result := make([]string, s.Len())
|
|
|
|
for i := 0; i < s.Len(); i++ {
|
|
result[i] = getValue(s.Index(i).Interface())
|
|
}
|
|
|
|
return result
|
|
}
|