SetDefaultNameProvider sets the [NameProvider] as a package-level default. By default, the default provider is [jsonname.DefaultJSONNameProvider]. It is safe to call concurrently with [Pointer.Get], [Pointer.Set], [GetForToken] and [SetForToken]. The typical usage is to call it once at initializat
(provider NameProvider)
| 31 | // |
| 32 | // A nil provider is ignored. |
| 33 | func SetDefaultNameProvider(provider NameProvider) { |
| 34 | if provider == nil { |
| 35 | return |
| 36 | } |
| 37 | |
| 38 | defaultOptionsMu.Lock() |
| 39 | defer defaultOptionsMu.Unlock() |
| 40 | |
| 41 | defaultOptions.provider = provider |
| 42 | } |
| 43 | |
| 44 | // UseGoNameProvider sets the [NameProvider] as a package-level default to the alternative provider |
| 45 | // [jsonname.GoNameProvider], that covers a few areas not supported by the default name provider. |
no outgoing calls
searching dependent graphs…