package temperature import "time" type TemperatureReading struct { Sensor string `json:"sensor"` Time time.Time `json:"time"` MilliDegrees int64 `json:"milli_degrees"` } func (t *TemperatureReading) Degrees() float64 { return float64(t.MilliDegrees) / 1000.0 }