mirror of
https://github.com/unpoller/unpoller.git
synced 2026-03-31 06:24:21 -04:00
* Fix panic when remote discovery fails and no controllers are configured Call setDefaults(&u.Default) before logController(&u.Default) when len(u.Controllers) == 0 so HashPII, DropPII, etc. are initialized and logController does not dereference nil pointers. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: trigger CI re-run Co-authored-by: Cursor <cursoragent@cursor.com> * ci: use golangci-lint v2.9 for Go 1.26-compatible deps Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -48,4 +48,6 @@ jobs:
|
||||
uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||
version: v2.6
|
||||
# v2.9 is built with Go 1.26 so it can type-check deps (e.g. golang.org/x/crypto, x/net) that include go1.26-only files.
|
||||
version: v2.9
|
||||
skip-cache: true
|
||||
|
||||
@@ -74,6 +74,7 @@ func (u *InputUnifi) Initialize(l poller.Logger) error {
|
||||
}
|
||||
|
||||
if len(u.Controllers) == 0 {
|
||||
u.setDefaults(&u.Default)
|
||||
u.Logf("No controllers configured. Polling dynamic controllers only! Defaults:")
|
||||
u.logController(&u.Default)
|
||||
}
|
||||
@@ -108,6 +109,7 @@ func (u *InputUnifi) DebugInput() (bool, error) {
|
||||
}
|
||||
|
||||
if len(u.Controllers) == 0 {
|
||||
u.setDefaults(&u.Default)
|
||||
u.Logf("No controllers configured. Polling dynamic controllers only! Defaults:")
|
||||
u.logController(&u.Default)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user