5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-09-20 19:32:31 +00:00
matterbridge/vendor/github.com/Philipp15b/go-steam/jsont/jsont.go

20 lines
341 B
Go
Raw Normal View History

2017-06-21 23:00:27 +00:00
// Includes helper types for working with JSON data
package jsont
import (
"encoding/json"
)
// A boolean value that can be unmarshaled from a number in JSON.
type UintBool bool
func (u *UintBool) UnmarshalJSON(data []byte) error {
var n uint
err := json.Unmarshal(data, &n)
if err != nil {
return err
}
*u = n != 0
return nil
}