github.com/theliebeskind/genfig@v0.1.5-alpha/example/config/init.go (about) 1 // Code generated by genfig on 2019-07-24T22:16:50+02:00; DO NOT EDIT. 2 3 package config 4 5 import ( 6 "fmt" 7 "os" 8 ) 9 10 var ( 11 _ = os.Getenv 12 _ = fmt.Printf 13 ) 14 15 // Current is the current config, selected by the curren env and 16 // updated by the availalbe env vars 17 var Current *Config 18 19 // This init tries to retrieve the current environment via the 20 // common env var 'ENV' and applies activated plugins 21 func init() { 22 Current, _ = Get(os.Getenv("ENV")) 23 24 // calling plugin substitutor 25 Current.Substitute() 26 27 // calling plugin update_from_env 28 if errs := Current.UpdateFromEnv(); errs != nil { 29 fmt.Println(errs) 30 } 31 32 }