mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 00:56:16 +00:00
style(setup): address actionable golangci-lint findings
Fixes the lint hits that pointed at real bugs or dead code; leaves the remaining style-only suggestions (rangeValCopy micro-copies, gocyclo informational, intentional name choices like SetupStateMachine) alone. - pkg/models/clockdisplay.go: restore <clockDisplay> XMLName tag on both ClockDisplay and ClockDisplayRequest. The earlier `xml:"-"` clashed with ClockDisplayUpdatedEvent.ClockDisplay's `xml:"clockDisplay"` tag (SA5008). Custom MarshalXML/UnmarshalXML still own the wire format. - pkg/service/setup/setup.go: drop the now-unused checkRemoteServices helper (replaced by applyProbeToSummary) and rename the unused deviceIP parameter of populatePlannedNetworkConfig to _. - pkg/service/setup/setup_session.go: collapse sendStep's (string, error) return to plain error — every caller already discarded the string. - pkg/service/setup/init_plan.go: rename shadowed err variables to rwErr / genErr / invalidErr / nilErr / stepErr. - cmd/soundtouch-cli/cmd_setup.go: drop redundant int(syscall.Stdin) conversion (already int) and rename a shadowed err to pairErr. go build ./..., go vet ./..., and tests for the touched packages all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
29a462da2b
commit
a1ae10650f
@@ -626,7 +626,7 @@ func promptBasicAuth() (string, string, error) {
|
||||
|
||||
fmt.Fprint(os.Stderr, "Password: ")
|
||||
|
||||
pass, err := term.ReadPassword(int(syscall.Stdin))
|
||||
pass, err := term.ReadPassword(syscall.Stdin)
|
||||
|
||||
fmt.Fprintln(os.Stderr)
|
||||
|
||||
@@ -1373,9 +1373,9 @@ func runPairBare(c *cli.Context, deviceIP, accountID string) error {
|
||||
|
||||
fmt.Printf("→ setMargeAccount accountID=%s (no SETUP bracket)\n", accountID)
|
||||
|
||||
if err := session.SetMargeAccount(ctx, accountID, ""); err != nil {
|
||||
PrintError(fmt.Sprintf("setMargeAccount: %v", err))
|
||||
return err
|
||||
if pairErr := session.SetMargeAccount(ctx, accountID, ""); pairErr != nil {
|
||||
PrintError(fmt.Sprintf("setMargeAccount: %v", pairErr))
|
||||
return pairErr
|
||||
}
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user