mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-28 04:05:21 +08:00
15 lines
180 B
Go
15 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)
|
|
}
|