2b041c02ad
* feat: add toPascalCase helper for config key display Adds a toPascalCase helper that converts dotted lowercase Viper config keys (e.g. 'scanner.schedule') to PascalCase (e.g. 'Scanner.Schedule') for use in user-facing warning messages. Includes export_test.go binding and a full Ginkgo DescribeTable test suite covering simple, dotted, multi-segment, already-capitalized, and empty-string cases. * feat: remap ND_-prefixed env var names found in config files Detect when users mistakenly use environment variable names (like ND_ADDRESS) in config files, remap them to canonical keys, and warn. Fatal error if both ND_ and canonical versions of the same key exist. Closes #5242
22 lines
371 B
Go
22 lines
371 B
Go
package conf
|
|
|
|
func ResetConf() {
|
|
Server = &configOptions{}
|
|
}
|
|
|
|
var SetViperDefaults = setViperDefaults
|
|
|
|
var ParseLanguages = parseLanguages
|
|
|
|
var ValidateURL = validateURL
|
|
|
|
var NormalizeSearchBackend = normalizeSearchBackend
|
|
|
|
var ToPascalCase = toPascalCase
|
|
|
|
func SetFatalFunc(f func(string)) func() {
|
|
old := fatalFunc
|
|
fatalFunc = f
|
|
return func() { fatalFunc = old }
|
|
}
|