ci: check format in CI pipeline (#17)
All checks were successful
CD / test (push) Successful in 20s
CD / Build and push (push) Successful in 2m41s

Reviewed-on: #17
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #17.
This commit is contained in:
2024-12-23 19:37:47 +01:00
committed by t.behrendt
parent a01c328ac5
commit ef57421268
5 changed files with 38 additions and 23 deletions

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

@@ -123,7 +123,7 @@ func (i *IonosAPIImpl) GetRecordId(zoneId string, tld string, subdomain string,
json.Unmarshal(responseBody, &zone)
var domain string
if subdomain == "@" || subdomain == "" {
if subdomain == "@" || subdomain == "" {
domain = tld
} else {
domain = subdomain + "." + tld
@@ -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)