In the application I'm writing I'd like refer to datapoints I create by the Datapoint interface. However, due to the fact that Unpack has pointer receiver, I cannot simply cast it, e.g.dpt.Datapoint(dpt.DPT_1001(value)).
cannot convert dpt.DPT_1001(value) (value of type dpt.DPT_1001) to type dpt.Datapoint: dpt.DPT_1001 does not implement dpt.Datapoint (method Unpack has pointer receiver)
Is there some other workaround I can take to accomplish this? Sorry if there's some obvious golang way of doing this. I know go enough to build myself an application but I don't know it by heart.
In the application I'm writing I'd like refer to datapoints I create by the
Datapoint
interface. However, due to the fact thatUnpack
has pointer receiver, I cannot simply cast it, e.g.dpt.Datapoint(dpt.DPT_1001(value))
.Is there some other workaround I can take to accomplish this? Sorry if there's some obvious golang way of doing this. I know go enough to build myself an application but I don't know it by heart.