mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-09 02:13:35 +00:00
Validate methods should satisfy the interface Validate() error. This commit fixes that bug.
This commit is contained in:
@@ -3,8 +3,6 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/alecthomas/kong"
|
||||
)
|
||||
|
||||
// MatrixCmdGroup defines the command group for controlling the Matrix outputs, including commands for mute state, fader level, and fade-in/fade-out times.
|
||||
@@ -22,7 +20,7 @@ type MatrixCmdGroup struct {
|
||||
} `help:"Commands for controlling individual Matrix outputs." arg:""`
|
||||
}
|
||||
|
||||
func (cmd *MatrixCmdGroup) Validate(ctx kong.Context) error {
|
||||
func (cmd *MatrixCmdGroup) Validate() error {
|
||||
if cmd.Index.Index < 1 || cmd.Index.Index > 6 {
|
||||
return fmt.Errorf("invalid Matrix output index: %d. Valid range is 1-6", cmd.Index.Index)
|
||||
}
|
||||
@@ -156,7 +154,11 @@ type MatrixEqCmdGroup struct {
|
||||
}
|
||||
|
||||
// Validate checks if the provided EQ band number is within the valid range (1-6) for the Matrix output.
|
||||
func (cmd *MatrixEqCmdGroup) Validate(ctx kong.Context) error {
|
||||
func (cmd *MatrixEqCmdGroup) Validate() error {
|
||||
if cmd.Band.Band == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if cmd.Band.Band < 1 || cmd.Band.Band > 6 {
|
||||
return fmt.Errorf("invalid EQ band number: %d. Valid range is 1-6", cmd.Band.Band)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user