feat: configio#59
Merged
Merged
Conversation
0ddc35c to
58c6a84
Compare
Codecov Report
@@ Coverage Diff @@
## feat/major-api-improvements #59 +/- ##
==============================================================
Coverage ? 81.64%
==============================================================
Files ? 27
Lines ? 899
Branches ? 0
==============================================================
Hits ? 734
Misses ? 137
Partials ? 28
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
8f09a6d to
3b14230
Compare
f2850a8 to
5d5465f
Compare
5d5465f to
1dbd54e
Compare
This was referenced Nov 6, 2022
83a2213 to
243547c
Compare
from benchttp/cli
Rethink exposed API so it matches the native json lib. - replace Parse -> Decode in all declarations and file names - expose top-level unmarshaling & decoding functions: - UnmarshalJSON, UnmarshalYAML: unmarshal bytes into *Representation - UnmarshalJSONRunner, UnmarshalYAMLRunner: same into *benchttp.Runner - NewJSONDecoder, NewYAMLDecoder: same as json.NewDecoder - DecoderOf: returns appropriate Decoder given an extension
Clarity over humor
- make testdata more robust easy to reason about using a dedicated package - use table testing - use benchttptest for runner comparison - extract assertXxx helpers
Do not expose testdata.
- use dedicated data structure (file) - rethink namings - move functions to appropriate places
1dbd54e to
5f1ed58
Compare
moreirathomas
approved these changes
Mar 28, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
masterDescription
Changes
configfilefrombenchttp/cliinto this repoUnmarshalandNewDecoder(in).Decode(&dst)configio.file)Dedicated package documentation (go doc + readme)➡️ Exhaustive documentation for package
configio#65Exposeconfigio.file?➡️ No use case for now
Static errors for decoders (same as file errors)➡️ TODO: create issue for error handling
Rethinkconfigio.Representation? (hardly usable besides direct unmarshaling)➡️ feat(configio): implement Builder #61
Implement encoding functions:benchttp.Runner->configio.Representation->[]byte(json/yaml)➡️ Implement and expose config encoding functions #63
Notes