Files
mtusi2026lab2/internal/storage/postgres/mapping.go
T
Vladislav Kunetskiy 1e38dbdf35
Application / Lint (pull_request) Canceled after 0s
Application / Unit tests (pull_request) Canceled after 0s
Application / Docker build (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab2
2026-10-06 18:58:40 +03:00

22 lines
318 B
Go

package postgres
import "time"
func toUTCTime(t time.Time) time.Time {
if t.Location() == time.UTC {
return t
}
return t.UTC()
}
func mapAll[S, D any](rows []S, mapRow func(S) D) []D {
mapped := make([]D, 0, len(rows))
for _, row := range rows {
mapped = append(mapped, mapRow(row))
}
return mapped
}