push
github
226 of 502 new or added lines in 15 files covered. (45.02%)
88 existing lines in 3 files now uncovered.8681 of 19744 relevant lines covered (43.97%)
0.5 hits per line
1 |
package template
|
|
2 |
|
|
3 |
import (
|
|
4 |
"fmt"
|
|
5 |
"github.com/spf13/cast"
|
|
6 |
) |
|
7 |
|
|
|
func toFloat64(v interface{}) float64 { |
1✔ |
|
return cast.ToFloat64(v)
|
1✔ |
|
} |
1✔ |
11 |
|
|
|
func toInt(v interface{}) int { |
1✔ |
|
return cast.ToInt(v)
|
1✔ |
|
} |
1✔ |
15 |
|
|
|
func toInt64(v interface{}) int64 { |
1✔ |
|
return cast.ToInt64(v)
|
1✔ |
|
} |
1✔ |
19 |
|
|
|
func strval(v interface{}) string { |
1✔ |
|
switch v := v.(type) { |
1✔ |
|
case string: |
1✔ |
|
return v
|
1✔ |
NEW
|
case []byte: |
× |
NEW
|
return string(v) |
× |
NEW
|
case error: |
× |
NEW
|
return v.Error()
|
× |
NEW
|
case fmt.Stringer:
|
× |
NEW
|
return v.String()
|
× |
|
default:
|
1✔ |
|
return fmt.Sprintf("%v", v) |
1✔ |
32 |
} |
|
33 |
} |