From 0e559fb8b28efd0e6bcb6957690ec4e4d22b5231 Mon Sep 17 00:00:00 2001 From: GoliathLabs Date: Fri, 29 Nov 2024 17:34:54 -0800 Subject: [PATCH] fix: linter --- go.mod | 4 ++-- go.sum | 8 ++++---- internal/dnsproxy/proxy.go | 4 ++-- internal/services/device_service.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e4bde49c..a98fbdc0 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/coreos/go-iptables v0.8.0 github.com/coreos/go-oidc/v3 v3.11.0 github.com/docker/docker v27.3.1+incompatible - github.com/freifunkMUC/pg-events v0.4.4 - github.com/freifunkMUC/wg-embed v0.10.3 + github.com/freifunkMUC/pg-events v0.4.5 + github.com/freifunkMUC/wg-embed v0.10.4 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 github.com/gorilla/sessions v1.4.0 diff --git a/go.sum b/go.sum index 7a795d5a..ddc7d4f1 100644 --- a/go.sum +++ b/go.sum @@ -87,10 +87,10 @@ github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/freifunkMUC/pg-events v0.4.4 h1:Zawv4MsAU1cH3Xd9ckH531fdCVoaiQ8vbM8z7C959yI= -github.com/freifunkMUC/pg-events v0.4.4/go.mod h1:vSXTUe05Ze9KanrBp+ohSMW8sdWVPK/M83plTW1d40k= -github.com/freifunkMUC/wg-embed v0.10.3 h1:MpeCjJiMiGqaWWVrTOka+BNZB8KGAxy1i2fRDbyBg/c= -github.com/freifunkMUC/wg-embed v0.10.3/go.mod h1:RtkfJVgBZAHVsw5U00iWwkfhDtRfpICpGm1q0JpoliA= +github.com/freifunkMUC/pg-events v0.4.5 h1:W0S0jnMq6AR8DcYbSL96JtSABuUogVDPB7A0T/M/wVs= +github.com/freifunkMUC/pg-events v0.4.5/go.mod h1:LdjJx0nBFEO+gmnwtV6MB5CKKPLEyt4dlyvj/Ggjg/4= +github.com/freifunkMUC/wg-embed v0.10.4 h1:q30ZWVktoO/ED8WGMp1Nb9hRkMpewSOaMT96g1l7CPI= +github.com/freifunkMUC/wg-embed v0.10.4/go.mod h1:jgHHsIvYRheflxrwxYfBfGUFThdWCgxwjxe6vewHWLQ= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= diff --git a/internal/dnsproxy/proxy.go b/internal/dnsproxy/proxy.go index f7ff9e2e..dd296054 100644 --- a/internal/dnsproxy/proxy.go +++ b/internal/dnsproxy/proxy.go @@ -80,14 +80,14 @@ func (d *DNSProxy) Lookup(m *dns.Msg) (*dns.Msg, error) { target := net.JoinHostPort(upstream, "53") resp, _, err := d.udpClient.Exchange(m, target) if err != nil && firstErr == nil { - logrus.Warnf(errors.Wrap(err, fmt.Sprintf("DNS lookup failed for upstream %s", upstream)).Error()) + logrus.Warnf("DNS lookup failed for upstream %s: %v", upstream, err) firstErr = err } else if err == nil { // Retry truncated responses over TCP if resp.Truncated { resp, _, err = d.tcpClient.Exchange(m, target) if err != nil && firstErr == nil { - logrus.Warnf(errors.Wrap(err, fmt.Sprintf("DNS lookup failed over TCP for upstream %s", upstream)).Error()) + logrus.Warnf("DNS lookup failed over TCP for upstream %s: %v", upstream, err) firstErr = err continue } diff --git a/internal/services/device_service.go b/internal/services/device_service.go index deb6e06c..6d487a03 100644 --- a/internal/services/device_service.go +++ b/internal/services/device_service.go @@ -28,7 +28,7 @@ func (d *DeviceService) AddDevice(ctx context.Context, req *proto.AddDeviceReq) device, err := d.DeviceManager.AddDevice(user, req.GetName(), req.GetPublicKey(), req.GetPresharedKey()) if err != nil { ctxlogrus.Extract(ctx).Error(err) - return nil, status.Errorf(codes.Internal, err.Error()) + return nil, status.Errorf(codes.Internal, "failed to process device: %v", err) } return mapDevice(device), nil