mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 16:32:31 +01:00
14 lines
180 B
Go
14 lines
180 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func ToString(val any, def string) string {
|
|
if val == nil {
|
|
return def
|
|
} else if val == "" {
|
|
return def
|
|
}
|
|
return fmt.Sprintf("%v", val)
|
|
}
|