mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 23:05:36 +08:00
11 lines
208 B
Go
11 lines
208 B
Go
package main
|
|
|
|
// safeStr returns an empty string if the pointer is nil, or the underlying string value if not nil.
|
|
func safeStr(str *string) string {
|
|
if str == nil {
|
|
return ""
|
|
} else {
|
|
return *str
|
|
}
|
|
}
|