Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3209322

Browse files
committedDec 2, 2020
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 bbb37db commit 3209322

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)
Please sign in to comment.