Skip to content

Commit 9632243

Browse files
committed
Document accepted edge case for encoding/json.MarshalIndent
1 parent ba46b98 commit 9632243

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ Forbidden basic types:
114114
Any composed types (struct, map, slice, array) containing a forbidden basic type. Any map
115115
using a key with a forbidden type (`bool`, `float32`, `float64`, `struct`).
116116

117+
## Accepted edge case
118+
119+
For `encoding/json.MarshalIndent`, there is a (pathological) edge case, where this
120+
function could [return an error](https://cs.opensource.google/go/go/+/refs/tags/go1.18:src/encoding/json/scanner.go;drc=refs%2Ftags%2Fgo1.18;l=181) for an otherwise safe argument, if the argument has
121+
a nesting depth larger than [`10000`](https://cs.opensource.google/go/go/+/refs/tags/go1.18:src/encoding/json/scanner.go;drc=refs%2Ftags%2Fgo1.18;l=144) (as of Go 1.18).
122+
117123
## Bugs found during development
118124

119125
During the development of `errcheckjson`, the following issues in package `encoding/json` of the Go standard library have been found and PR have been merged:

0 commit comments

Comments
 (0)