clarify readme, extract setters

This commit is contained in:
2023-11-02 22:35:05 -07:00
parent 89b969ee2c
commit 47821829af
3 changed files with 34 additions and 29 deletions

14
env.go
View File

@@ -273,20 +273,6 @@ func (c *ConfigManager) SetEnvPrefix(prefix string) {
c.envPrefix = prefix
}
func (c *ConfigManager) Set(key string, value any) {
c.mutex.Lock()
defer c.mutex.Unlock()
lower := strings.ToLower(key)
c.mapConfig[lower] = ConfigMap{Key: key, Value: value}
}
func (c *ConfigManager) SetDefault(key string, value any) {
c.mutex.Lock()
defer c.mutex.Unlock()
lower := strings.ToLower(key)
c.defaultConfig[lower] = ConfigMap{Key: key, Value: value}
}
func (c *ConfigManager) GetIntSlice(key string) []int {
c.mutex.RLock()
defer c.mutex.RUnlock()