mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-16 21:10:47 +08:00
Updated config file to log config file close error
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
@@ -106,7 +107,11 @@ It is a plain text value by default but you can provide a SHA256 hash by adding
|
||||
if f, err := os.Open(*config); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
defer f.Close()
|
||||
defer func() {
|
||||
if err = f.Close(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}()
|
||||
|
||||
ext := path.Ext(f.Name())
|
||||
|
||||
@@ -127,7 +132,7 @@ It is a plain text value by default but you can provide a SHA256 hash by adding
|
||||
|
||||
}
|
||||
|
||||
// If requirePass is etc to true, then password must be provided as well
|
||||
// If requirePass is set to true, then password must be provided as well
|
||||
var err error = nil
|
||||
|
||||
if conf.RequirePass && conf.Password == "" {
|
||||
|
Reference in New Issue
Block a user