File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,6 @@ func (r *RuleSet) UnmarshalJSON(bytes []byte) error {
48
48
if r .Tag == "" {
49
49
return E .New ("missing tag" )
50
50
}
51
- if r .Type != C .RuleSetTypeInline {
52
- switch r .Format {
53
- case "" :
54
- return E .New ("missing format" )
55
- case C .RuleSetFormatSource , C .RuleSetFormatBinary :
56
- default :
57
- return E .New ("unknown rule-set format: " + r .Format )
58
- }
59
- } else {
60
- r .Format = ""
61
- }
62
51
var v any
63
52
switch r .Type {
64
53
case "" , C .RuleSetTypeInline :
@@ -71,6 +60,17 @@ func (r *RuleSet) UnmarshalJSON(bytes []byte) error {
71
60
default :
72
61
return E .New ("unknown rule-set type: " + r .Type )
73
62
}
63
+ if r .Type != C .RuleSetTypeInline {
64
+ switch r .Format {
65
+ case "" :
66
+ return E .New ("missing format" )
67
+ case C .RuleSetFormatSource , C .RuleSetFormatBinary :
68
+ default :
69
+ return E .New ("unknown rule-set format: " + r .Format )
70
+ }
71
+ } else {
72
+ r .Format = ""
73
+ }
74
74
err = UnmarshallExcluded (bytes , (* _RuleSet )(r ), v )
75
75
if err != nil {
76
76
return err
You can’t perform that action at this time.
0 commit comments