Skip to content

unsupported-marshal-type

Detect channels and functions passed to JSON or XML marshaling.

Updated View as Markdown

Default severity: error

The standard JSON and XML encoders cannot marshal channel or function values. The check recursively checks exported fields, while honoring ignored fields and custom marshaling methods.

Bad

json.Marshal(make(chan int))

Good

json.Marshal(struct{ Name string }{Name: name})
Navigation

Type to search…

↑↓ navigate↵ selectEsc close