gihub-action
1058 of 2194 new or added lines in 34 files covered. (48.22%)
1226 of 2474 relevant lines covered (49.56%)
16.23 hits per line
1 |
package models
|
|
2 |
|
|
3 |
type SerializableBool bool |
|
4 |
|
|
NEW
|
func (s SerializableBool) MarshalBinary() (data []byte, err error) { |
× |
NEW
|
if s {
|
× |
NEW
|
return []byte{byte(1)}, nil |
× |
NEW
|
} |
× |
NEW
|
return []byte{byte(0)}, nil |
× |
10 |
} |
|
11 |
|
|
NEW
|
func (s *SerializableBool) UnmarshalBinary(data []byte) error { |
× |
NEW
|
if data[0] == byte(1) { |
× |
NEW
|
*s = true
|
× |
NEW
|
} |
× |
NEW
|
*s = false
|
× |
NEW
|
return nil |
× |
18 |
} |
|
19 |
|
|
NEW
|
func (s SerializableBool) MarshalText() (data []byte, err error) { |
× |
NEW
|
if s {
|
× |
NEW
|
return []byte("true"), nil |
× |
NEW
|
} |
× |
NEW
|
return []byte("false"), nil |
× |
25 |
} |
|
26 |
|
|
NEW
|
func (s *SerializableBool) UnmarshalText(data []byte) error { |
× |
NEW
|
if string(data) == "true" { |
× |
NEW
|
*s = true
|
× |
NEW
|
} |
× |
NEW
|
*s = false
|
× |
NEW
|
return nil |
× |
33 |
} |