ente/server/pkg/utils/string/string.go
2024-03-01 13:37:01 +05:30

11 lines
184 B
Go

package string
// EmptyIfNil returns either the dereferenced string, or "" if the pointer is
// nil.
func EmptyIfNil(sp *string) string {
if sp == nil {
return ""
}
return *sp
}