config: return error if plugin type is empty (#4235)

This commit is contained in:
fatedier
2024-05-23 14:52:12 +08:00
committed by GitHub
parent 301515d2e8
commit 522e2c94c1
3 changed files with 14 additions and 1 deletions

View File

@@ -120,6 +120,10 @@ func (c *TypedVisitorConfig) UnmarshalJSON(b []byte) error {
return nil
}
func (c *TypedVisitorConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(c.VisitorConfigurer)
}
func NewVisitorConfigurerByType(t VisitorType) VisitorConfigurer {
v, ok := visitorConfigTypeMap[t]
if !ok {