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 {
4848 if r .Tag == "" {
4949 return E .New ("missing tag" )
5050 }
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- }
6251 var v any
6352 switch r .Type {
6453 case "" , C .RuleSetTypeInline :
@@ -71,6 +60,17 @@ func (r *RuleSet) UnmarshalJSON(bytes []byte) error {
7160 default :
7261 return E .New ("unknown rule-set type: " + r .Type )
7362 }
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+ }
7474 err = UnmarshallExcluded (bytes , (* _RuleSet )(r ), v )
7575 if err != nil {
7676 return err
You can’t perform that action at this time.
0 commit comments