This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
backend/pkg/utils/safe_pointer.go

16 lines
194 B
Go

package utils
func SafeBoolPointer(v *bool, def bool) bool {
if v == nil {
return def
}
return *v
}
func SafeIntPointer(s *int, def int) int {
if s == nil {
return def
}
return *s
}