var name should not be error (#5332)

Rename the variable names from "error" to "err"
This commit is contained in:
silenceshell 2018-07-24 11:33:21 +08:00 committed by Daniel Jiang
parent e9d5913d63
commit 7745b79b2e
2 changed files with 6 additions and 6 deletions

View File

@ -74,9 +74,9 @@ func NewCfgStore() (store.Driver, error) {
// Read configuration from database
func (c *cfgStore) Read() (map[string]interface{}, error) {
configEntries, error := dao.GetConfigEntries()
if error != nil {
return nil, error
configEntries, err := dao.GetConfigEntries()
if err != nil {
return nil, err
}
return WrapperConfig(configEntries)
}

View File

@ -54,9 +54,9 @@ func SaveConfigEntries(entries []models.ConfigEntry) error {
tempEntry := models.ConfigEntry{}
tempEntry.Key = entry.Key
tempEntry.Value = entry.Value
created, _, error := o.ReadOrCreate(&tempEntry, "k")
if error != nil {
return error
created, _, err := o.ReadOrCreate(&tempEntry, "k")
if err != nil {
return err
}
if !created {
entry.ID = tempEntry.ID