diff options
author | Adam Mathes <adam@trenchant.org> | 2017-01-26 20:17:55 -0800 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2017-01-26 20:17:55 -0800 |
commit | 66b37908f062eef46594d52a905cd2bde55dd505 (patch) | |
tree | 5d5e7d86dc8aed3cec26323126f9527ad0888120 /util | |
parent | 857ac6caf70eff11f0770972a7619e4e3229a39c (diff) | |
download | neko-66b37908f062eef46594d52a905cd2bde55dd505.tar.gz neko-66b37908f062eef46594d52a905cd2bde55dd505.tar.bz2 neko-66b37908f062eef46594d52a905cd2bde55dd505.zip |
fix cmds
Diffstat (limited to 'util')
-rw-r--r-- | util/util.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/util/util.go b/util/util.go new file mode 100644 index 0000000..ca12fdb --- /dev/null +++ b/util/util.go @@ -0,0 +1,18 @@ +package util + +import ( + "neko/config" + "neko/models" + "os" +) + +var DEFAULT_CONFIG = "config.json" + +func init() { + var configFile = DEFAULT_CONFIG + if len(os.Args) > 1 { + configFile = os.Args[1] + } + config.Read(configFile) + models.InitDB(config.Config.DBServer) +} |