Validate methods should satisfy the interface Validate() error. This commit fixes that bug.

This commit is contained in:
2026-02-10 01:17:35 +00:00
parent cf470181a1
commit 2e1c28c909
8 changed files with 42 additions and 25 deletions

View File

@@ -3,8 +3,6 @@ package main
import (
"fmt"
"time"
"github.com/alecthomas/kong"
)
// BusCmdGroup defines the commands related to controlling the buses of the X-Air device.
@@ -183,7 +181,11 @@ type BusEqCmdGroup struct {
}
// Validate checks that the provided EQ band number is within the valid range (1-6).
func (cmd *BusEqCmdGroup) Validate(ctx kong.Context) error {
func (cmd *BusEqCmdGroup) Validate() error {
if cmd.Band.Band == 0 {
return nil
}
if cmd.Band.Band < 1 || cmd.Band.Band > 6 {
return fmt.Errorf("EQ band number must be between 1 and 6")
}