From 5c07f58b7fc32a10c0244a4470a158439bc2471b Mon Sep 17 00:00:00 2001 From: hi019 <65871571+hi019@users.noreply.github.com> Date: Sat, 31 Oct 2020 11:09:14 -0400 Subject: [PATCH] Use ConfigDefault --- sqlite3/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sqlite3/config.go b/sqlite3/config.go index decb4368..9044cee3 100644 --- a/sqlite3/config.go +++ b/sqlite3/config.go @@ -12,6 +12,8 @@ type Config struct { // ConfigDefault is the default config var ConfigDefault = Config{ GCInterval: 10 * time.Second, + FilePath: "./db.sqlite3", + TableName: "fiber", } // Helper function to set default values @@ -20,10 +22,10 @@ func configDefault(cfg Config) Config { cfg.GCInterval = ConfigDefault.GCInterval } if cfg.FilePath == "" { - cfg.FilePath = "./db" + cfg.FilePath = ConfigDefault.FilePath } if cfg.TableName == "" { - cfg.TableName = "fiber" + cfg.TableName = ConfigDefault.TableName } return cfg }