[FAB-17508] Removing viper library from viperutil #1511
Merged
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.
Type of change
Improvement (improvement to code by avoiding viper library that is not
needed in this context)
Description
Avoiding the overlap in the implementation of getKeysRecursively and
viper.Get() function. The sub-keys needed by getKeysRecursively is
readily available and the usage of viper.Get() can be avoided.
The reference to viper library is removed from the following modules
A ConfigParser class is created in viperutil/config_utils.go to achieve
the needed funtionality.
Additional details
Unit tests done are the following
go test -race -count 1 -v -run Test github.com/hyperledger/fabric/orderer/common/localconfig | tail -2
PASS
ok github.com/hyperledger/fabric/orderer/common/localconfig
1.260s
go test -race -count 1 -v -run Test github.com/hyperledger/fabric/internal/configtxgen/genesisconfig | tail -2
PASS
ok github.com/hyperledger/fabric/internal/configtxgen/genesisconfig
1.115s
go test -race -count 1 -v -run Test github.com/hyperledger/fabric/common/viperutil | tail -2
PASS
ok github.com/hyperledger/fabric/common/viperutil 0.793s
go test -race -count 1 -v -run Test github.com/hyperledger/fabric/orderer/consensus/etcdraft | tail -2
PASS
ok github.com/hyperledger/fabric/orderer/consensus/etcdraft
52.528s
go test -race -count 1 -v -run Test github.com/hyperledger/fabric/orderer/consensus/etcdraft | grep SUCCESS!
SUCCESS! -- 107 Passed | 0 Failed | 0 Pending | 0 Skipped
Related issues
https://jira.hyperledger.org/browse/FAB-17508
Signed-off-by: NicholasB nbasker@gmail.com
Type of change
Description
Avoiding the overlap in the implementation of getKeysRecursively and
viper.Get() function.
Additional details
Unit Tests Done
Related issues
https://jira.hyperledger.org/browse/FAB-17508