@@ -329,7 +329,7 @@ func loadSchemas(schemaFolder string, schemas *Schemas) error {
329329 return nil
330330 } else {
331331 // Something else went wrong
332- return fmt .Errorf ("error loading schemas from %s: %s " , schemaFolder , err )
332+ return fmt .Errorf ("error loading schemas from %s: %w " , schemaFolder , err )
333333 }
334334 }
335335 return fs .WalkDir (os .DirFS (schemaFolder ), "." , getSchemasWalkProcessor (schemaFolder , schemas ))
@@ -343,7 +343,7 @@ func generate(schemaFolders []string, genFolder, prefix, specVersion string, tem
343343 Slice : make ([]Data , 0 ),
344344 SpecVersion : specVersion ,
345345 SpecVersionShort : shortSpecVersion ,
346- SpecVersionName : strings .Replace (shortSpecVersion , "." , "" , - 1 ),
346+ SpecVersionName : strings .ReplaceAll (shortSpecVersion , "." , "" ),
347347 IsTestData : isTestMode ,
348348 }
349349
@@ -433,14 +433,14 @@ func getSchemasWalkProcessor(rootDir string, schemas *Schemas) fs.WalkDirFunc {
433433 schemaPath := filepath .Join (rootDir , path )
434434 schemaBytes , err := os .ReadFile (schemaPath )
435435 if err != nil {
436- return fmt .Errorf ("cannot read schema file at %s: %v " , schemaPath , err )
436+ return fmt .Errorf ("cannot read schema file at %s: %w " , schemaPath , err )
437437 }
438438 schema := struct {
439439 Id string `json:"$id"`
440440 }{}
441441 // Load the jsonschema from the spec
442442 if err := json .Unmarshal (schemaBytes , & schema ); err != nil {
443- return fmt .Errorf ("cannot unmarshal schema file at %s: %v " , schemaPath , err )
443+ return fmt .Errorf ("cannot unmarshal schema file at %s: %w " , schemaPath , err )
444444 }
445445 // If no $id is defined ignore this file
446446 if schema .Id == "" {
0 commit comments