encoding/json for JSON encode/decode. Unmarshal and Decoder.Decode deserialize JSON into Go values — the destination struct becomes tainted if the input bytes are user-controlled. Encoder.Encode writes JSON to a writer, a sink when the writer is an HTTP response.
.Unmarshal().Decode().Encode().Encode()SinkEncode(v any) error
Writes v as JSON to the underlying writer. Sink when writer is a response and v contains raw HTML.
0.Marshal()NeutralMarshal(v any) ([]byte, error)
Serializes v to JSON bytes. Generally neutral.
.NewDecoder()NeutralNewDecoder(r io.Reader) *Decoder
Creates a streaming decoder bound to r. Decoder.Decode is the actual source.
.NewEncoder()NeutralNewEncoder(w io.Writer) *Encoder
Creates a streaming encoder bound to w. Encoder.Encode is the actual sink.
| FQN | Field | |
|---|---|---|
| encoding/json | fqns[0] | |
| encoding/json.Decoder | fqns[1] | |
| json.* | patterns |
Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.
// standard library — no go.mod entry required
from codepathfinder.go_rule import GoJSON