Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lint errors for KeywordRegistry struct
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
carolynvs committed Jul 22, 2021
1 parent b7bc812 commit 4ede4ee
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
@@ -11,6 +11,8 @@ func LoadDraft2019_09() {
r.LoadDraft2019_09()
}

// DefaultIfEmpty populates the KeywordRegistry with the 2019_09
// jsonschema draft specification.
func (r *KeywordRegistry) DefaultIfEmpty() {
if !r.IsRegistryLoaded() {
r.LoadDraft2019_09()
3 changes: 3 additions & 0 deletions keyword.go
Original file line number Diff line number Diff line change
@@ -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
@@ -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)),

0 comments on commit 4ede4ee

Please sign in to comment.