diff --git a/app.go b/app.go index b8fa54c4..85cb96ae 100644 --- a/app.go +++ b/app.go @@ -158,7 +158,7 @@ func main() { go func() { refreshFiltersIfNeccessary(false) // Save the updated config - err := writeConfig() + err := config.write() if err != nil { log.Fatal(err) } @@ -170,7 +170,7 @@ func main() { } // Save the updated config - err := writeConfig() + err := config.write() if err != nil { log.Fatal(err) } diff --git a/config.go b/config.go index f79923a4..3fead5a1 100644 --- a/config.go +++ b/config.go @@ -171,7 +171,7 @@ func parseConfig() error { } // Saves configuration to the YAML file and also saves the user filter contents to a file -func writeConfig() error { +func (c *configuration) write() error { c.Lock() defer c.Unlock() configFile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename) @@ -217,7 +217,7 @@ func writeCoreDNSConfig() error { } func writeAllConfigs() error { - err := writeConfig() + err := config.write() if err != nil { log.Printf("Couldn't write our config: %s", err) return err