show config file
This commit is contained in:
@@ -71,6 +71,8 @@ func FetchNewConfigFileThenInit() {
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
|
||||
fmt.Println(string(body))
|
||||
|
||||
err = yaml.Unmarshal(body, &config.SourceConfig)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
2
main.go
2
main.go
@@ -52,10 +52,10 @@ func main() {
|
||||
}
|
||||
|
||||
func initConfigFile(path string) {
|
||||
fmt.Println("Config file:", path)
|
||||
if strings.HasPrefix(path, "http") {
|
||||
config.Url = path
|
||||
config.NeedFetch = true
|
||||
app.FetchNewConfigFileThenInit()
|
||||
} else {
|
||||
err := app.InitConfigAndGetters(configFilePath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user