From 1abf36686caf6961a07ebfad7fac8f31a0f66574 Mon Sep 17 00:00:00 2001 From: Patrick Hofmann Date: Wed, 9 Jul 2025 18:27:19 +0200 Subject: [PATCH] fixing lint issue --- serial.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serial.go b/serial.go index 90fed8f..d2e37a1 100644 --- a/serial.go +++ b/serial.go @@ -234,9 +234,10 @@ func setDCRestoreState(state int) error { return err } command := "RESTORE_MODE_OFF\n" - if state == 1 { + switch state { + case 1: command = "RESTORE_MODE_ON\n" - } else if state == 2 { + case 2: command = "RESTORE_MODE_LAST_STATE\n" } _, err = port.Write([]byte(command))