xxgreg / altjson

Alternative JSON is a fork of encoding/json with a couple of extra features added

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

encoding/json: implement type override for serialization

The fork adds the following APIs:

	func (*Encoder) Register(f interface{})
	func (*Decoder) Register(f interface{})

where f is a function that determines serialization for a specific type and takes precedence over the MarshalJSON/UnmarshalJSON methods.

See: golang/go#5901

It is forked from this MR: https://go-review.googlesource.com/c/go/+/212998

About

Alternative JSON is a fork of encoding/json with a couple of extra features added

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%