Cannot marshal channels or functions SCC-SA1026
Bug risk
Major
5 months ago3 years old
trying to marshal unsupported type func(*github.com/beego/beego/v2/server/web/context.Context, *Config), via x.RecoverFunc
 54
 55func TestAssignConfig_02(t *testing.T) {
 56	_BConfig := &Config{}
 57	bs, _ := json.Marshal(newBConfig()) 58
 59	jsonMap := M{}
 60	json.Unmarshal(bs, &jsonMap)
trying to marshal unsupported type map[interface{}]interface{}
 55	data["Content"] = template.HTMLEscapeString(result.String())
 56
 57	if format == "json" && command == "gc summary" {
 58		dataJSON, err := json.Marshal(data) 59		if err != nil {
 60			http.Error(rw, err.Error(), http.StatusInternalServerError)
 61			return
trying to marshal unsupported type func() time.Time, via x.TLS.Time
111		Endpoints:   []string{addr},
112		DialTimeout: 3 * time.Second,
113	}
114	cfg, _ := json.Marshal(obj)115	return string(cfg)
116}
trying to marshal unsupported type func() (io.ReadCloser, error), via x.Resp.Request.GetBody
256		},
257	}
258
259	jsonStr, err := json.Marshal(input)260	require.NoError(t, err)
261	resp := slideShowResponse{}
262	err = client.Put(&resp, "/req2resp", jsonStr)
trying to marshal unsupported type func() (io.ReadCloser, error), via x.Resp.Request.GetBody
228		},
229	}
230
231	jsonStr, err := json.Marshal(input)232	require.NoError(t, err)
233	resp := slideShowResponse{}
234	err = client.Post(&resp, "/req2resp", jsonStr)