Skip to content

Commit 655e1bc

Browse files
committed
Use properties.SafeLoadFromPath() to load library.properties
In the event of a problem loading, this will return an empty map rather than nil. The error already serves as the indicator of this problem for the invalid library.properties check, so having an empty map as the output only simplifies the handling of that situation in the other checks.
1 parent b00dbbe commit 655e1bc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

project/library/libraryproperties/libraryproperties.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ import (
2626

2727
// Properties parses the library.properties from the given path and returns the data.
2828
func Properties(libraryPath *paths.Path) (*properties.Map, error) {
29-
libraryProperties, err := properties.LoadFromPath(libraryPath.Join("library.properties"))
30-
if err != nil {
31-
return nil, err
32-
}
33-
return libraryProperties, nil
29+
return properties.SafeLoadFromPath(libraryPath.Join("library.properties"))
3430
}
3531

3632
var schemaObject = make(map[compliancelevel.Type]*jsonschema.Schema)

0 commit comments

Comments
 (0)