mirror of
https://github.com/foomo/gocontemplate.git
synced 2025-10-16 12:35:36 +00:00
14 lines
187 B
Go
14 lines
187 B
Go
package assume
|
|
|
|
// T type conversion helper
|
|
func T[T any](input any) T {
|
|
var output T
|
|
if input == nil {
|
|
return output
|
|
}
|
|
if t, ok := input.(T); ok {
|
|
output = t
|
|
}
|
|
return output
|
|
}
|