stubNameProvider is a NameProvider that maps JSON names to Go field names via a fixed dictionary. It lets tests observe which provider was used by the resolver without relying on the default reflection-based behavior.
| 17 | // It lets tests observe which provider was used by the resolver without relying on the default |
| 18 | // reflection-based behavior. |
| 19 | type stubNameProvider struct { |
| 20 | mu sync.Mutex |
| 21 | mapping map[string]string |
| 22 | lookups []string |
| 23 | forTypes []string |
| 24 | } |
| 25 | |
| 26 | func (s *stubNameProvider) GetGoName(_ any, name string) (string, bool) { |
| 27 | s.record(name, false) |
nothing calls this directly
no outgoing calls
no test coverage detected