diff --git a/pkg/core/object/fmt.go b/pkg/core/object/fmt.go index 36ea25f94..5dc64af30 100644 --- a/pkg/core/object/fmt.go +++ b/pkg/core/object/fmt.go @@ -157,6 +157,8 @@ func (v *FormatValidator) ValidateContent(o *Object) error { return errors.Errorf("(%T) empty member in SG", v) } } + default: + return errors.Errorf("(%T) unsupported object type %s", v, o.Type()) } return nil diff --git a/pkg/policy/json.go b/pkg/policy/json.go index 33eb7986b..a0b474fdb 100644 --- a/pkg/policy/json.go +++ b/pkg/policy/json.go @@ -177,6 +177,8 @@ func (f *filter) fromNetmap(nf *netmap.Filter) { f.Op = "AND" case netmap.OR: f.Op = "OR" + default: + // do nothing } if nf.GetFilters() != nil { f.Filters = make([]filter, len(nf.GetFilters())) @@ -216,6 +218,8 @@ func (s *selector) fromNetmap(ns *netmap.Selector) { s.Clause = "same" case netmap.Distinct: s.Clause = "distinct" + default: + // do nothing } s.Name = ns.GetName() }