Skip to content

Commit

Permalink
Fixed #61
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Aug 5, 2022
1 parent 133db28 commit b279807
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/tidwall/sjson
go 1.14

require (
github.com/tidwall/gjson v1.12.1
github.com/tidwall/gjson v1.14.2
github.com/tidwall/pretty v1.2.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo=
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.14.2 h1:6BBkirS0rAHjumnjHF6qgy5d2YAJ1TLIaFE2lzfOLqo=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
Expand Down
14 changes: 14 additions & 0 deletions sjson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,17 @@ func TestIndexes(t *testing.T) {
t.Fatal("mismatch")
}
}

func TestIssue61(t *testing.T) {
json := `{
"@context": {
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"@vocab": "http://schema.org/",
"sh": "http://www.w3.org/ns/shacl#"
}
}`
json1, _ := Set(json, "@context.@vocab", "newval")
if gjson.Get(json1, "@context.@vocab").String() != "newval" {
t.Fail()
}
}

0 comments on commit b279807

Please sign in to comment.