/insertjson

A small package for inserting properties into byte-encoded JSON objects with Golang.

Primary LanguageGoMIT LicenseMIT

MIT licensed Build Status Go Report Card GoDoc Coverage Status

InsertJSON

A small package for performantly inserting properties into byte-encoded JSON objects using Golang.

Usage

package main 

import (
    "github.com/b3ntly/insertjson"
)

func main(){
    key := "id"
    value := "1"
    example := []byte(`{"name":"fred", "thing":"foo"}`)
    println(string(insertjson.Property(key, value, example))
}
{"id":"1","name":"fred", "thing":"foo"}