Hey Gophers,

I'm trying to store a data point as a JSON (w/struct) with a Call back 
function to call when the item is loaded with data

Just marshaling the struct into JSON nets a blank item.. any suggestions?

example:

type Item struct {
 name string
 callback func()
 data int
}

...

func times100(i int) {
 return i * 100
}

m := Item{
 name: "first",
 callback: times100,
 data: 10,
}

.. data is loaded later after functions run... then it should run data 
through m.callback(data)

after striking out I thought about switching it to a string and doing a 
switch.. but let me know maybe i'm just doing something wrong with the 
callback definition 

thanks,
MB

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/04e5bc8a-2a75-49b8-9510-5de9425d3858%40googlegroups.com.

Reply via email to