push
github
26 of 49 new or added lines in 17 files covered. (53.06%)
22 existing lines in 1 file now uncovered.3645 of 5616 relevant lines covered (64.9%)
3.74 hits per line
| 1 |
package utils
|
|
| 2 |
|
|
| 3 |
// Ptr returns a pointer to the given value.
|
|
|
NEW
|
func Ptr[T any](v T) *T {
|
× |
|
NEW
|
return &v
|
× |
|
NEW
|
} |
× |
| 7 |
|
|
| 8 |
// Val returns the actual value from a pointer or a zeroed value if the pointer is nil.
|
|
|
NEW
|
func Val[T any](v *T) T {
|
× |
|
NEW
|
if v == nil { |
× |
|
NEW
|
var zero T
|
× |
|
NEW
|
return zero
|
× |
|
NEW
|
} |
× |
|
NEW
|
return *v
|
× |
| 15 |
} |