func()

in events/epoch_time.go [34:48]


func (e *SecondsEpochTime) UnmarshalJSON(b []byte) error {
	var epoch float64
	err := json.Unmarshal(b, &epoch)
	if err != nil {
		return err
	}

	epochSec := int64(epoch)
	epochNano := int64((epoch - float64(epochSec)) * float64(secondsToNanoSecondsFactor))

	// time.Unix(sec, nsec) expects the epoch integral seconds in the first parameter
	// and remaining nanoseconds in the second parameter
	*e = SecondsEpochTime{time.Unix(epochSec, epochNano)}
	return nil
}