feat: add IsNilOrZero utility function to common package

This commit is contained in:
2025-10-12 21:11:51 +04:00
parent d1ea7874fe
commit 82197ac9b9
2 changed files with 24 additions and 0 deletions

10
common/compare.go Normal file
View File

@@ -0,0 +1,10 @@
package common
func IsNilOrZero[T comparable](value *T) bool {
if value == nil {
return true
}
var zero T
return *value == zero
}