diff --git a/go.mod b/go.mod index 534cb26..fa6b7e8 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 1a9d4de..ec6ee0a 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/sjson_test.go b/sjson_test.go index 752c93a..aa3d968 100644 --- a/sjson_test.go +++ b/sjson_test.go @@ -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() + } +}