-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ffyaml: interpret null/empty value as empty string instead of error (#83
) * Proposed change to YAML parser functionality, allowing empty values for each of the 6 supported golang datatypes ff lib (string, int, bool, duration, float, slice) and setting them to the 'zero value for that type; reference: #81 Signed-off-by: Aram Openden <[email protected]> * cleanup & add new comments Signed-off-by: Aram Openden <[email protected]> * format code Signed-off-by: Aram Openden <[email protected]> * clarify new code comment Signed-off-by: Aram Openden <[email protected]> * added new public function comment Signed-off-by: Aram Openden <[email protected]> * Added new unit test for YAML parser Signed-off-by: Aram Openden <[email protected]> * format test file Signed-off-by: Aram Openden <[email protected]> * Addressed 2 PR comments: formatting fixes Signed-off-by: Aram Openden <[email protected]> * PR feedback: removed test function checkParseErr() -> pushed up code into test functions Signed-off-by: Aram Openden <[email protected]> * New Updated YAML parser approach to handling blank (empty) YAML file entries -> Always assume that a blank node value is an empty string, and return that as the value; Also assocated Unit Test changes Signed-off-by: Aram Openden <[email protected]> * fixed imports Signed-off-by: Aram Openden <[email protected]> * Remove many changes * Test empty YAML nodes for various flag types * Fix tests * Refactor var comparison to t.Error Co-authored-by: Aram Openden <[email protected]>
- Loading branch information
1 parent
556df77
commit 17a8312
Showing
9 changed files
with
91 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
s: woozlewozzle | ||
i: |
2 changes: 1 addition & 1 deletion
2
ffyaml/testdata/no_value.yaml → ffyaml/testdata/no_value_s.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
i: 123 | ||
s: | ||
i: 123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters