push
github
67 of 192 new or added lines in 20 files covered. (34.9%)
2 existing lines in 2 files now uncovered.390 of 1109 relevant lines covered (35.17%)
5.74 hits per line
| 1 |
package example2
|
|
| 2 |
|
|
| 3 |
import (
|
|
| 4 |
"encoding/json"
|
|
| 5 |
|
|
| 6 |
"github.com/pkg/errors"
|
|
| 7 |
"github.com/yyle88/sure/internal/utils"
|
|
| 8 |
) |
|
| 9 |
|
|
|
NEW
|
func Neat[T any](a T) ([]byte, error) { |
× |
|
NEW
|
return utils.NeatBytes(a)
|
× |
|
UNCOV
12
|
} |
× |
| 13 |
|
|
|
NEW
|
func Bind[T any](data []byte) (*T, error) { |
× |
|
NEW
|
var a T
|
× |
|
NEW
|
if err := json.Unmarshal(data, &a); err != nil { |
× |
|
NEW
|
return nil, errors.WithMessage(err, "wrong") |
× |
|
NEW
|
} |
× |
|
NEW
|
return &a, nil |
× |
| 20 |
} |