chore: fmt modify

This commit is contained in:
guoguangwu
2023-06-08 12:08:48 +08:00
parent 27ae25ec12
commit e71815cf03
5 changed files with 8 additions and 8 deletions

View File

@@ -99,12 +99,12 @@ func (c *JSONConfigContainer) sub(key string) (map[string]interface{}, error) {
}
value, ok := c.data[key]
if !ok {
return nil, errors.New(fmt.Sprintf("key is not found: %s", key))
return nil, fmt.Errorf("key is not found: %s", key)
}
res, ok := value.(map[string]interface{})
if !ok {
return nil, errors.New(fmt.Sprintf("the type of value is invalid, key: %s", key))
return nil, fmt.Errorf("the type of value is invalid, key: %s", key)
}
return res, nil
}

View File

@@ -120,11 +120,11 @@ func (c *ConfigContainer) sub(key string) (map[string]interface{}, error) {
}
value, ok := c.data[key]
if !ok {
return nil, errors.New(fmt.Sprintf("the key is not found: %s", key))
return nil, fmt.Errorf("the key is not found: %s", key)
}
res, ok := value.(map[string]interface{})
if !ok {
return nil, errors.New(fmt.Sprintf("the value of this key is not a structure: %s", key))
return nil, fmt.Errorf("the value of this key is not a structure: %s", key)
}
return res, nil
}