UseGoNameProvider sets the [NameProvider] as a package-level default to the alternative provider [jsonname.GoNameProvider], that covers a few areas not supported by the default name provider. This implementation supports untagged exported fields and embedded types in go struct. It follows strictly
()
| 51 | // [SetForToken]. |
| 52 | // The typical usage is to call it once at initialization time. |
| 53 | func UseGoNameProvider() { |
| 54 | SetDefaultNameProvider(jsonname.NewGoNameProvider()) |
| 55 | } |
| 56 | |
| 57 | // DefaultNameProvider returns the current package-level [NameProvider]. |
| 58 | func DefaultNameProvider() NameProvider { //nolint:ireturn // returning the interface is the point — callers pick their own implementation. |
searching dependent graphs…