Skip to content

Commit

Permalink
Fix lint errors for KeywordRegistry struct
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <[email protected]>
  • Loading branch information
carolynvs committed Jul 22, 2021
1 parent b7bc812 commit 39ced0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions draft2019_09_keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ func LoadDraft2019_09() {
r.LoadDraft2019_09()
}

// DefaultIfEmpty populates the KeywordRegistry with the 2019_09
// jsonschema draft specification only if the registry is empty.
func (r *KeywordRegistry) DefaultIfEmpty() {
if !r.IsRegistryLoaded() {
r.LoadDraft2019_09()
Expand Down
3 changes: 3 additions & 0 deletions keyword.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var notSupported = map[string]bool{
var kr *KeywordRegistry
var krLock sync.Mutex

// KeywordRegistry contains a mapping of jsonschema keywords and their
// expected behavior.
type KeywordRegistry struct {
keywordRegistry map[string]KeyMaker
keywordOrder map[string]int
Expand All @@ -52,6 +54,7 @@ func copyGlobalKeywordRegistry() *KeywordRegistry {
return kr.Copy()
}

// Copy creates a new KeywordRegistry populated with the same data.
func (r *KeywordRegistry) Copy() *KeywordRegistry {
dest := &KeywordRegistry{
keywordRegistry: make(map[string]KeyMaker, len(r.keywordRegistry)),
Expand Down

0 comments on commit 39ced0c

Please sign in to comment.