Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions format_checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ var (
lock = new(sync.RWMutex)
)

// Empty resets the FormatCheckerChain
func (c *FormatCheckerChain) Empty() {
lock.Lock()
c.formatters = make(map[string]FormatChecker)
lock.Unlock()
}

// Add adds a FormatChecker to the FormatCheckerChain
// The name used will be the value used for the format key in your json schema
func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain {
Expand Down