Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolsconfig:chore: create tests and rename public objects #764

Merged
merged 1 commit into from
Nov 12, 2021

Commits on Nov 11, 2021

  1. toolsconfig: create tests and rename public objects

    Previously the toolsconfig package does not have any unit tests and the
    public functions and types was a bit confused, since two types was
    exported to represents the same "thing".
    
    This commit implements the tests to cover scenarios of toolsconfig
    parsing.
    
    This commit also rename ToolsConfigStruct to toolsConfig and also made
    private, since this struct is only used as schema to parse the values
    and only the Map type is used by other packages. The Map and Config
    struct was also renamed to don't be repetitive on names.
    
    The function ParseInterfaceToMapToolsConfig was also renamed to
    MustParseToolsConfig to follow the Go standards of functions that can
    cause errors that will be not returned. The signature was also changed
    to avoid bugs when accepting an empty interface{}, since the viper will
    always return a map[string]interface{} when we get the tools config from
    config file, this function does not need to accept an empty interface.
    
    A new function Default was also created to return the default values
    from tools config.
    
    Updates #718
    
    Signed-off-by: Matheus Alcantara <[email protected]>
    matheusalcantarazup committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    b6ff11f View commit details
    Browse the repository at this point in the history