Fix lint and format code in core dir

This commit is contained in:
loyalsoldier
2021-06-06 21:00:27 +08:00
parent ca328208cc
commit 41790b80ac
42 changed files with 75 additions and 109 deletions

View File

@@ -47,7 +47,6 @@ func (c *Config) ParseData(data []byte) (config.Configer, error) {
return &configContainer{
t: t,
}, nil
}
// configContainer support key looks like "a.b.c"
@@ -70,7 +69,6 @@ func (c *configContainer) Set(key, val string) error {
// return error if key not found or value is invalid type
func (c *configContainer) String(key string) (string, error) {
res, err := c.get(key)
if err != nil {
return "", err
}
@@ -90,7 +88,6 @@ func (c *configContainer) String(key string) (string, error) {
// return error if key not found or value is invalid type
func (c *configContainer) Strings(key string) ([]string, error) {
val, err := c.get(key)
if err != nil {
return []string{}, err
}
@@ -141,9 +138,7 @@ func (c *configContainer) Int64(key string) (int64, error) {
// bool return bool value
// return error if key not found or value is invalid type
func (c *configContainer) Bool(key string) (bool, error) {
res, err := c.get(key)
if err != nil {
return false, err
}
@@ -330,7 +325,6 @@ func (c *configContainer) get(key string) (interface{}, error) {
segs := strings.Split(key, keySeparator)
t, err := subTree(c.t, segs[0:len(segs)-1])
if err != nil {
return nil, err
}