From 12354304785f007cb90effcd176bb990319d653a Mon Sep 17 00:00:00 2001 From: brngates98 Date: Sun, 25 Jan 2026 10:58:08 -0500 Subject: [PATCH] Update to unifi library v5.6.0 and fix linter errors - Update go.mod to use unifi library v5.6.0 (includes remote API support) - Remove temporary replace directive now that v5.6.0 is published - Fix empty-block linter errors in input.go by removing empty if blocks --- go.mod | 5 +---- go.sum | 2 ++ pkg/inputunifi/input.go | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 95fbbc6c..a620f168 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/prometheus/common v0.67.5 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 - github.com/unpoller/unifi/v5 v5.5.0 + github.com/unpoller/unifi/v5 v5.6.0 golang.org/x/crypto v0.47.0 golang.org/x/term v0.39.0 golift.io/cnfg v0.2.3 @@ -46,6 +46,3 @@ require ( golang.org/x/sys v0.40.0 // indirect google.golang.org/protobuf v1.36.11 // indirect ) - -// for local iterative development only -replace github.com/unpoller/unifi/v5 => ../unifi diff --git a/go.sum b/go.sum index 046c16a2..060b42e6 100644 --- a/go.sum +++ b/go.sum @@ -77,6 +77,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/unpoller/unifi/v5 v5.6.0 h1:qryEAJNYXG/WbjIqrIEZ/npRNBwHTsv/ZFbseYry8ug= +github.com/unpoller/unifi/v5 v5.6.0/go.mod h1:vSIXIclPG9dpKxUp+pavfgENHWaTZXvDg7F036R1YCo= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= diff --git a/pkg/inputunifi/input.go b/pkg/inputunifi/input.go index da9208d7..2c8746fb 100644 --- a/pkg/inputunifi/input.go +++ b/pkg/inputunifi/input.go @@ -304,10 +304,8 @@ func (u *InputUnifi) setDefaults(c *Controller) { //nolint:cyclop // Remote mode: only API key is used, no user/pass // For remote mode, API key is required // Will be set from RemoteAPIKey in Config if not provided - if c.APIKey != "" { - c.User = "" - c.Pass = "" - } + c.User = "" + c.Pass = "" } else { // Local mode: use API key if provided, otherwise user/pass if c.APIKey == "" {