This repository has been archived by the owner on Nov 5, 2022. It is now read-only.
v0.3.1
Fixes a race condition where unmarshaling json with bytes.Buffer
across multiple goroutines caused panics.
SetUnmarshalHook
is an optional hook allowing you to unmarshal json in a thread-safe way. By default you will stream []byte
. However, this is not thread-safe.
This hook allows you to unmarshal json in the same goroutine where the bytes.Buffer
was created, making it thread-safe.
See this example for how to use this hook well.