On Thu, 16 Jun 2016 04:55:41 -0700 (PDT)
User123 <twisters...@gmail.com> wrote:

> Is it giving error since it has null values? 
> 
> I'm just not able to get it. Since this code works perfectly fine in
> 1.4.2

A wild guess:

1) Your error message is:

     json: unsupported type: <-chan struct {}

   and indeed the docs of encoding/json clearly state that certain
   types cannot be sensibly marshalled and unmarshalled.
   Channel types are among them.

2) Some value contained as a field of your value -- which is supposedly
   of some custom struct type -- started to contain a variable of type

     <-chan struct{}

   somewhere between 1.4.2 and 1.6.

   This might be not an immediate field of your struct-typed value
   but a field of a value which is an immediate field, and so on --
   deeper down the hierarchy -- because the json encoder is recursive.

Hence inspect what your value might clinge on which is not *pure data.*
Say, an http.Client instance is not pure data.

Once identified, make sure you convert your existing value you're
encoding to a value of some other type which contains nothing but pure
data values.

[...]
> > I did fmt.println on the data that I am trying to marshall and it
> > looks like this
> >
> > *%!(EXTRA main.JobResponseRoot={{92b4f95b309e8db0f8d56afadefc}
> > http.res {[{{  map[] <nil>}
> > "Date","Time","Time_Zone","Source","Name","Raw_Data"*
> > * <nil> 0x10a3c2d0}]}})*
[...]
> >>> The data  I am trying to marshal contains serialized data. This
> >>> data is received in http response.
> >>>
> >>> It works perfectly when I try in version 1.4.1/ 1.4.2.
> >>>
> >>> But when I try this to the latest version 1.6 it gives an error:
> >>> *json: unsupported type: <-chan struct {}*
[...]

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to