Re: [go-nuts] Store function name as JSON?

2020-04-30 Thread Brian Candler
Or initialize a map with your functions, and lookup in the map. -- 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

Re: [go-nuts] Store function name as JSON?

2020-04-29 Thread Reto
On Wed, Apr 29, 2020 at 02:17:44PM -0700, MichaelB wrote: > 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 Functions aren't serializeable to json, it's not one of the types json supports. > Just marshaling the struct

[go-nuts] Store function name as JSON?

2020-04-29 Thread MichaelB
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