Skip to content

Commit

Permalink
fixup: var names
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
  • Loading branch information
toddbaert committed Jan 5, 2024
1 parent 285710b commit 468f2f4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions json/flagd_definitions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ import (
"github.com/xeipuuv/gojsonschema"
)

var schemaLoader *gojsonschema.SchemaLoader
var s *gojsonschema.Schema
var compiledSchema *gojsonschema.Schema

func init() {
schemaLoader = gojsonschema.NewSchemaLoader()
schemaLoader := gojsonschema.NewSchemaLoader()
schemaLoader.AddSchemas(gojsonschema.NewStringLoader(flagd_definitions.Targeting))
var err error
s, err = schemaLoader.Compile(gojsonschema.NewStringLoader(flagd_definitions.FlagdDefinitions))
compiledSchema, err = schemaLoader.Compile(gojsonschema.NewStringLoader(flagd_definitions.FlagdDefinitions))
if err != nil {
s := fmt.Errorf("err: %v", err)
log.Fatal(s)
message := fmt.Errorf("err: %v", err)
log.Fatal(message)
}
}

Expand Down Expand Up @@ -57,7 +56,7 @@ func walkPath(shouldPass bool, root string) error {

flagStringLoader := gojsonschema.NewStringLoader(string(file))

p, err := s.Validate(flagStringLoader)
p, err := compiledSchema.Validate(flagStringLoader)
if err != nil {
return err
}
Expand Down

0 comments on commit 468f2f4

Please sign in to comment.