mirror of
https://github.com/ZSCNetSupportDept/scheduler.git
synced 2025-10-28 20:45:05 +08:00
Amend
This commit is contained in:
@@ -13,7 +13,7 @@ func Load() {
|
|||||||
|
|
||||||
parseArgs()
|
parseArgs()
|
||||||
readconfig()
|
readconfig()
|
||||||
fmt.Println(Default)
|
fmt.Printf("%+v\n", Default)
|
||||||
|
|
||||||
carbon.SetDefault(carbon.Default{
|
carbon.SetDefault(carbon.Default{
|
||||||
Layout: carbon.DateTimeLayout,
|
Layout: carbon.DateTimeLayout,
|
||||||
@@ -35,7 +35,7 @@ func readconfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseArgs() {
|
func parseArgs() {
|
||||||
pflag.String("config", "config.yaml", "the path to config file.")
|
pflag.String("config", "./config.yaml", "the path to config file.")
|
||||||
viper.BindPFlags(pflag.CommandLine)
|
viper.BindPFlags(pflag.CommandLine)
|
||||||
pflag.Parse()
|
pflag.Parse()
|
||||||
pathToConfigure = viper.GetString("config")
|
pathToConfigure = viper.GetString("config")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type Config struct {
|
|||||||
File string `mapstructure:"File"`
|
File string `mapstructure:"File"`
|
||||||
} `mapstructure:"app"`
|
} `mapstructure:"app"`
|
||||||
DB struct {
|
DB struct {
|
||||||
Type string `mapstructure:"Tyoe"`
|
Type string `mapstructure:"Type"`
|
||||||
Path string `mapstructure:"Path"`
|
Path string `mapstructure:"Path"`
|
||||||
Port int `mapstructure:"Port"`
|
Port int `mapstructure:"Port"`
|
||||||
User string `mapstructure:"User"`
|
User string `mapstructure:"User"`
|
||||||
|
|||||||
Reference in New Issue
Block a user