mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-10 23:33:00 +03:00
fix: empty lists don't get returned correctly from the api
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
|
||||
// MapStructList maps a list of source structs to a list of destination structs
|
||||
func MapStructList[S any, D any](source []S, destination *[]D) error {
|
||||
*destination = make([]D, 0, len(source))
|
||||
|
||||
for _, item := range source {
|
||||
var destItem D
|
||||
if err := MapStruct(item, &destItem); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user