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
12 changes: 12 additions & 0 deletions format_checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ func (c *FormatCheckerChain) Has(name string) bool {
return ok
}

// List lists by name all FormatChecker held in the FormatCheckerChain
func (c *FormatCheckerChain) List() []string {
names := make([]string, 0, 18)
lock.RLock()
for name := range c.formatters {
names = append(names, name)
}
lock.RUnlock()

return names
}

// IsFormat will check an input against a FormatChecker with the given name
// to see if it is the correct format
func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool {
Expand Down