mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
16 lines
286 B
Go
16 lines
286 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/oapi-codegen/nullable"
|
|
)
|
|
|
|
// NullableToString converts a nullable stringer to a string
|
|
func NullableToString[T fmt.Stringer](x nullable.Nullable[T]) string {
|
|
if !x.IsSpecified() || x.IsNull() {
|
|
return ""
|
|
}
|
|
return x.MustGet().String()
|
|
}
|