-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix config struct processing, add (much needed) tests
Added: - Tests (partial implementation/coverage) - validate the most common code-paths (much more TODO) - config handling - logging setup - run tests as part of GitHub Actions Workflow - recursively - after getting deps, but before linting steps in order to allow early failure - update Makefile to run tests recursively, verbosely - Fix configuration precedence handling - Add string slice equality check from StackOverflow Changed: - Fix configuration precedence handling - Config file loses to everything except default config settings - `config.logBuffer` moved to `logging.LogBuffer` - internal detail exposed for general use - may change this later - Updated code (where apparent) to be more test friendly - e.g., use `io.Reader` instead of filename so that we can use an in-memory TOML config file for testing config parsing and precedence validation - Split config package into smaller files in an effort to make related code easier to manage - Fail if requested config file not found - previously an error was logged, but execution was allowed to continue. - Move default values to Getter methods - use those methods instead of directly dereferencing config struct fields in the majority of the code - use Getter methods to guard against nil dereferences - Partial work to de-couple reliance on `Config{}` (see #170) Deprecated: Both of these functions from the `config` package do not appear to be needed any longer, but are being kept for a cycle in case I change my mind: - `Config.SetDefaultConfig()` - `Config.GetStructTag()` Fixed: - Fix configuration precedence handling - Config settings are merged properly, so that even default settings are allowed to override lower precedence config sources - NumFilesToKeep default (didn't match v0.5.1 change) - Add missing `default` switch statements along with error return codes for `Set` functions with specific valid option values - README updates - cover config file flag, environment variables - config precedence corrections - Multiple linting errors (with more that needs to be evaluated) - Add missing exit if IgnoreErrors is false - Handle unintended nil assignment - Update GoDoc doc file - reflect config file support, including updated Help text TODO: - Update multiple tests to use "tables" instead of hard-coding specific checks (which ends up being very lengthy) - e.g., `TestValidate()` - Various goconst linting errors refs #161, #156, #170, #176
- Loading branch information
Showing
24 changed files
with
3,501 additions
and
540 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
Oops, something went wrong.