gihub-action
1060 of 2195 new or added lines in 34 files covered. (48.29%)
1225 of 2469 relevant lines covered (49.62%)
16.33 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 |
} |