From b47705363b47cc7b0ad2eac15bd42ef9ad378263 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Tue, 29 Aug 2023 15:51:05 +0800 Subject: [PATCH] Add TypeRegistry clean --- metadata.go | 4 ---- types/registry.go | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/metadata.go b/metadata.go index 8c8ec96..770a885 100644 --- a/metadata.go +++ b/metadata.go @@ -31,7 +31,3 @@ func (m *MetadataDecoder) Process() error { return errors.New("not metadata") } - -// CheckRegistry -// Deprecated -func (m *MetadataDecoder) CheckRegistry() (notReg []string) { return } diff --git a/types/registry.go b/types/registry.go index deb9c72..fc01af1 100644 --- a/types/registry.go +++ b/types/registry.go @@ -39,7 +39,19 @@ func HasReg(typeName string) bool { return ok } +// Clean all type registry +func Clean() { + TypeRegistry = nil + specialRegistry = make(map[string][]Special) + V14Types = nil + regBaseType() +} + func init() { + regBaseType() +} + +func regBaseType() { registry := make(map[string]interface{}) scales := []interface{}{ &Null{},