Addressed review suggestion

This commit is contained in:
Prithvipal Singh 2020-02-22 23:25:31 +05:30
parent 0439aef712
commit 1879ad91cd
1 changed files with 9 additions and 1 deletions

View File

@ -74,7 +74,15 @@ c?ildren.0 "Sara"
Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\`.
```go
fav\\.movie "Deer Hunter"
fav\.movie "Deer Hunter"
```
You'll also need to make sure that the `\` character is correctly escaped when hardcoding a path in source code.
```go
res := gjson.Get(json, "fav\\.movie") // must escape the slash
res := gjson.Get(json, `fav\.movie`) // no need to escape the slash
```
### Arrays