From 8f5716c858c73044815e91ef635c843b61399e66 Mon Sep 17 00:00:00 2001 From: orvice L Date: Sat, 26 Oct 2024 18:14:57 +0800 Subject: [PATCH] fix lint --- cmd/ddns/main.go | 8 -------- internal/app/app.go | 2 +- internal/config/config.go | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/ddns/main.go b/cmd/ddns/main.go index 6e968bb..a098eda 100644 --- a/cmd/ddns/main.go +++ b/cmd/ddns/main.go @@ -5,17 +5,9 @@ import ( "log/slog" "os" - "github.com/orvice/ddns/dns" - "github.com/orvice/ddns/internal/ip" "github.com/orvice/ddns/internal/wire" ) -var ( - dnsProvider dns.LibDNS - ipGetter ip.Getter - DNSMode string -) - var ( IPNotifyFormat = "[%s] ip changed, old IP: %s new IP: %s" ) diff --git a/internal/app/app.go b/internal/app/app.go index 87102e0..265d201 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -94,7 +94,7 @@ func (a *App) updateIP(ctx context.Context) error { a.logger.Error("Set records error", "error", err) return err } - a.notifier.Send(ctx, fmt.Sprintf(IPNotifyFormat, a.config.Domain, oldIP, ip)) + _ = a.notifier.Send(ctx, fmt.Sprintf(IPNotifyFormat, a.config.Domain, oldIP, ip)) } else { _, err = a.dnsProvider.AppendRecords(ctx, zone, []libdns.Record{ { diff --git a/internal/config/config.go b/internal/config/config.go index cc3331c..0cb676e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -17,7 +17,7 @@ type Config struct { } func New() (*Config, error) { - var path string = "." + path := "." viper.AddConfigPath(path) viper.SetConfigName("app")