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
maxekman
changed the title
Giving missing field error for a struct containing private fields only
[commandhandler] Giving missing field error for a struct containing private fields only
Sep 6, 2018
Problem
When defining a struct with private fields only as command data,
missing field
error is always thrown.Problem is caused by private fields are skipped and default checking result is always
true
.https://github.com/looplab/eventhorizon/blob/master/command.go#L159-L167
e.g. 1
e.g. 2
Suggestion
Set the default result of struct checking as
false
https://github.com/looplab/eventhorizon/blob/master/command.go#L160
And suggest to use
validator
for custom struct:https://github.com/looplab/eventhorizon/blob/master/middleware/commandhandler/validator/commandhandler.go
The text was updated successfully, but these errors were encountered: