Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
712f3b65cf
|
|||
7b77ef35af
|
@ -48,6 +48,9 @@ func NewConfig() *Config {
|
||||
}
|
||||
|
||||
if unicode.IsLetter(getFirstRune(key)) {
|
||||
if len(config.mapEnv[left]) == 0 {
|
||||
config.mapEnv[left] = make(map[string]cEntry)
|
||||
}
|
||||
var entry cEntry
|
||||
entry.value = splitted[1]
|
||||
entry.dtype = TypeNone
|
||||
@ -81,8 +84,8 @@ func (c *Config) Define(key string, dtype DataType) {
|
||||
// Define the type of an environment variable.
|
||||
// Variables without a defined type will be ignored by Parse.
|
||||
func (c *Config) DefineMap(key string, dtype DataType) {
|
||||
upper := strings.ToUpper(key)
|
||||
entries, ok := c.mapEnv[upper]
|
||||
key = cleanKey(key)
|
||||
entries, ok := c.mapEnv[key]
|
||||
if ok {
|
||||
for mapKey, entry := range entries {
|
||||
entry.dtype = dtype
|
||||
|
Reference in New Issue
Block a user