29 lines
502 B
Go
29 lines
502 B
Go
package main
|
|
|
|
import (
|
|
"bash_go_service/shared/pkg/constants"
|
|
"bash_go_service/shared/pkg/logger"
|
|
"fmt"
|
|
"version/handler"
|
|
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
// initConfig 初始化配置
|
|
func initConfig() error {
|
|
viper.AddConfigPath(constants.ConfigPath)
|
|
return viper.ReadInConfig()
|
|
}
|
|
|
|
func main() {
|
|
if err := initConfig(); err != nil {
|
|
fmt.Printf("Failed to init config: %v", err)
|
|
return
|
|
}
|
|
logger.UpdateLogLevel()
|
|
|
|
logger.Debug("Version: %s", constants.CurrentVersion)
|
|
|
|
handler.DoUpdate()
|
|
}
|