Coming back to this after several more months of Go under my belt I came up with the following (updated, thanks zupa) solution.
func (f *Foo) SetData(data interface{}) {
f.data = unsafe.Pointer(&data)
}
func (f *Foo) Data() interface{} {
return unsafe.Pointer(f.data)
}
And can be used in the following manner:
type Player struct {
Name string
}
p := &Player{
Name: "Player1",
}
f.SetData(p)
log.Print(f.Data().(*Player).Name) // Outputs: Player1