new
This commit is contained in:
xiexiaojun
2019-05-14 21:19:00 +08:00
parent 6511a0be74
commit 3acd87d714
4 changed files with 7 additions and 6 deletions

2
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,2 @@
{
}

View File

@@ -2,7 +2,9 @@ package config
import ( import (
"fmt" "fmt"
"public/tools"
"github.com/xie1xiao1jun/public/dev"
"github.com/xie1xiao1jun/public/tools"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
) )
@@ -20,6 +22,7 @@ var _map = Config{}
func init() { func init() {
onInit() onInit()
dev.OnSetDev(_map.IsDev)
} }
func onInit() { func onInit() {
@@ -31,11 +34,6 @@ func onInit() {
} }
} }
//OnIsDev ... 是否是开发版本
func OnIsDev() bool {
return _map.IsDev
}
//InitFile ... //InitFile ...
func InitFile(filename string) error { func InitFile(filename string) error {
if _, err := toml.DecodeFile(filename, &_map); err != nil { if _, err := toml.DecodeFile(filename, &_map); err != nil {

View File

@@ -24,6 +24,7 @@ func Execute() {
rows.Scan(&table) rows.Scan(&table)
tables = append(tables, table) tables = append(tables, table)
} }
fmt.Println(tables) fmt.Println(tables)
} }

BIN
debug Executable file

Binary file not shown.