I'm trying to make simple read settings from config file. Both files - config.json and Settings.go, are in the same folder. But I'm always getting "The system cannot find the file specified."
What I'm doing wrong?
func GetDbConnectionString() string {
file, err := os.Open("config.json")
if err != nil {
log.Fatal(err)
}
decoder := json.NewDecoder(file)
settings := Settings{}
err1 := decoder.Decode(&settings)
if err1 != nil {
fmt.Println("error:", err1)
}
log.Print(&settings)
return fmt.Sprintf("%s:%s@/%s", settings.login, settings.password, settings.database)
}