Skip to content

Commit

Permalink
Add TypeRegistry clean
Browse files Browse the repository at this point in the history
  • Loading branch information
freehere107 committed Aug 29, 2023
1 parent d41bcde commit b477053
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ func (m *MetadataDecoder) Process() error {
return errors.New("not metadata")

}

// CheckRegistry
// Deprecated
func (m *MetadataDecoder) CheckRegistry() (notReg []string) { return }
12 changes: 12 additions & 0 deletions types/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down

0 comments on commit b477053

Please sign in to comment.