mirror of
https://github.com/golang/go
synced 2024-11-20 03:04:40 -07:00
encoding/json: documentation fix
Fixes #3650 R=golang-dev, adg CC=golang-dev https://golang.org/cl/6238046
This commit is contained in:
parent
1f46cb0ba2
commit
83771afe10
@ -96,7 +96,7 @@ import (
|
|||||||
//
|
//
|
||||||
// Channel, complex, and function values cannot be encoded in JSON.
|
// Channel, complex, and function values cannot be encoded in JSON.
|
||||||
// Attempting to encode such a value causes Marshal to return
|
// Attempting to encode such a value causes Marshal to return
|
||||||
// an InvalidTypeError.
|
// an UnsupportedTypeError.
|
||||||
//
|
//
|
||||||
// JSON cannot represent cyclic data structures and Marshal does not
|
// JSON cannot represent cyclic data structures and Marshal does not
|
||||||
// handle them. Passing cyclic structures to Marshal will result in
|
// handle them. Passing cyclic structures to Marshal will result in
|
||||||
@ -157,6 +157,8 @@ type Marshaler interface {
|
|||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// An UnsupportedTypeError is returned by Marshal when attempting
|
||||||
|
// to encode an unsupported value type.
|
||||||
type UnsupportedTypeError struct {
|
type UnsupportedTypeError struct {
|
||||||
Type reflect.Type
|
Type reflect.Type
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user