implemented data sources with prisma in go

This commit is contained in:
2025-01-02 13:19:55 +00:00
parent cfb0bdf9cf
commit 615e749a12
55 changed files with 1399 additions and 788 deletions
+11
View File
@@ -0,0 +1,11 @@
package utils
// Let applies a function `f` to a pointer value `ptr` if it's not nil.
// Returns nil if the pointer is nil.
func Let[T any, R any](ptr *T, f func(T) R) *R {
if ptr == nil {
return nil
}
result := f(*ptr)
return &result
}