lint: fix revive issues from golangci-lint 2.8.0

Add nolint directive for flag.Parse() in external driver server (the
Serve function is intended to be called from main). Add exclusion for
"api" package names in hostagent and guestagent.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
This commit is contained in:
Jan Dubois committed 2026-01-15 19:09:35 -08:00
1 parent 734da9f86c
commit de1571f501
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -148,6 +148,11 @@ linters:
- linters:
- godot
path: _test\.go
# Allow "api" package names in hostagent and guestagent.
- linters:
- revive
path: pkg/(hostagent|guestagent)/api/
text: avoid meaningless package names
issues:
# Maximum issues count per one linter.
max-issues-per-linter: 0
+1 -1
View File
@@ -55,7 +55,7 @@ func (t *listenerTracker) Accept() (net.Conn, error) {
func Serve(ctx context.Context, driver driver.Driver) {
preConfiguredDriverAction := flag.Bool("pre-driver-action", false, "Run pre-driver action before starting the gRPC server")
inspectStatus := flag.Bool("inspect-status", false, "Inspect status of the driver")
flag.Parse()
flag.Parse() //nolint:revive // Serve is intended to be called from external driver's main()
if *preConfiguredDriverAction {
handlePreConfiguredDriverAction(ctx, driver)
return