style: align format to go default formatting
All checks were successful
CI / test (pull_request) Successful in 36s

This commit is contained in:
2024-12-23 19:27:20 +01:00
parent a01c328ac5
commit de4147e29d
3 changed files with 20 additions and 22 deletions

28
main.go
View File

@@ -74,20 +74,20 @@ func main() {
rdd := realDynDns.New(externalIpProvider, dnsProvider, notificationProvider, configClient.Domains)
switch configClient.Mode {
case config.ScheduledMode:
schedule, job, err := rdd.RunWithSchedule(configClient.CheckInterval)
if err != nil {
panic(err)
}
case config.ScheduledMode:
schedule, job, err := rdd.RunWithSchedule(configClient.CheckInterval)
if err != nil {
panic(err)
}
fmt.Println("Starting scheduler")
fmt.Println("Next run:", job.NextRun())
schedule.StartBlocking()
case config.RunOnceMode:
numberOfChanges, err := rdd.RunOnce()
if err != nil {
panic(err)
}
fmt.Println("Number of changes:", numberOfChanges)
fmt.Println("Starting scheduler")
fmt.Println("Next run:", job.NextRun())
schedule.StartBlocking()
case config.RunOnceMode:
numberOfChanges, err := rdd.RunOnce()
if err != nil {
panic(err)
}
fmt.Println("Number of changes:", numberOfChanges)
}
}

View File

@@ -18,8 +18,8 @@ type Config struct {
}
const (
RunOnceMode = "RunOnce"
ScheduledMode = "Scheduled"
RunOnceMode = "RunOnce"
ScheduledMode = "Scheduled"
)
type DomainConfig struct {
@@ -56,7 +56,7 @@ func (c *Config) Load(filePath string) error {
return fmt.Errorf("failed to validate config: %w", err)
}
return nil;
return nil
}
func (c *Config) validate() error {
@@ -68,5 +68,5 @@ func (c *Config) validate() error {
return errors.New("check interval must be set when mode is 'Scheduled'")
}
return nil;
return nil
}

View File

@@ -171,8 +171,6 @@ func (i *IonosAPIImpl) SetARecord(tld string, subdomain string, ip net.IP, ttl i
return nil, errors.New("error updating record")
}
changeRecord := ChangeRecord{}
json.Unmarshal(responseBody, &changeRecord)