You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mismatched fields: [expected "age" to be a int but it's a string]
97
97
```
98
98
99
-
`FieldMismatch.String()` returns a simple user friendly message describing what the issue is. You can of course use your own custom message instead.
99
+
`FieldMismatch.String()` returns a simple user friendly message describing what the issue is. You can of course use your own custom message instead.
100
+
101
+
## Universal Type Names
102
+
103
+
By default, `CompareMapToStruct` will use the `TypeNameDetailed` func when reporting a type mismatch. The detailed type name includes some extra information that you may not want a client to see.
104
+
105
+
For example, trying to convert a `float64` into an `int32` will report a mismatch between `float64` and `int32`.
106
+
107
+
If you don't want to include bit size, you can use `TypeNameSimple` which converts `floatX -> float`, `intX -> int`, `uintX -> uint`.
0 commit comments