Clone this repo:


  1. 02993c4 Replace link to the I-D to by a link to the RFC by Kévin Dunglas · 3 years, 9 months ago master
  2. df4f5c8 go fmt project by Kirill Motkov · 3 years, 10 months ago
  3. 4e3ac27 Merge pull request #3 from Aetheus/master by xeipuuv · 5 years ago
  4. 02e5c6a allow Set function to set a value even if no value previously existed by Adrian · 6 years ago
  5. 2ec2e00 implement deleting for array members by Adrian · 6 years ago


An implementation of JSON Pointer - Go language


jsonText := `{
	"name": "Bobby B",
	"occupation": {
		"title" : "King",
		"years" : 15,
		"heir" : "Joffrey B"			

var jsonDocument map[string]interface{}
json.Unmarshal([]byte(jsonText), &jsonDocument)

//create a JSON pointer
pointerString := "/occupation/title"
pointer, _ := NewJsonPointer(pointerString)

//SET a new value for the "title" in the document     
pointer.Set(jsonDocument, "Supreme Leader of Westeros")

//GET the new "title" from the document
title, _, _ := pointer.Get(jsonDocument)
fmt.Println(title) //outputs "Supreme Leader of Westeros"

//DELETE the "heir" from the document
deletePointer := NewJsonPointer("/occupation/heir")

b, _ := json.Marshal(jsonDocument)
//outputs `{"name":"Bobby B","occupation":{"title":"Supreme Leader of Westeros","years":15}}`



The 4.Evaluation part of the previous reference, starting with ‘If the currently referenced value is a JSON array, the reference token MUST contain either...’ is not implemented.