-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
customimages: avoid type casting and add tests
Previously the implementation of CustomImages map was a bit redundant. Basically a map[string]string was created using the string representation of each languages.language as key, and when were we going to access this map we always receive a languages.Language and need to get the string representation of this language, which make an unnecessary type casting. This commit change the type of CustomImages to store a languages.Language as key and avoid these type casting. The function `NewCustomImages` was renamed to `Default` to make more clear and a new function `MustParseCustomImages` was created to parse the input taken from Viper. This commit also add some new tests to assert the default values and test the parsing. Updates #718 Signed-off-by: Matheus Alcantara <matheus.alcantara@zup.com.br>
- Loading branch information
1 parent
c09446c
commit fc08e1c
Showing
7 changed files
with
203 additions
and
34 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
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