I have two calls to config.GetConfig() and IDE shows me an error on the second call
func main() {
config := config.GetConfig()
fmt.Println(config.Port)
config.Port = 999
fmt.Println(config.Port) // 999
config1 := config.GetConfig() // config.GetConfig undefined (type config.Config has no field or method GetConfig)
...
where in config package
var cfg Config
func init(){
...
cfg = Config{
Host: _host,
...
}
}
func GetConfig() Config {
return cfg
}
What it the problem here?