From 338ce20eb41f168ddd48cea7be0bb3702f1aa144 Mon Sep 17 00:00:00 2001 From: Kai Xia Date: Tue, 24 Feb 2026 21:48:21 +1100 Subject: [PATCH] make fmt Signed-off-by: Kai Xia --- pkg/tools/i2c.go | 8 +++++--- pkg/tools/spi.go | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/tools/i2c.go b/pkg/tools/i2c.go index 8ff157316..779b1d5a7 100644 --- a/pkg/tools/i2c.go +++ b/pkg/tools/i2c.go @@ -95,7 +95,9 @@ func (t *I2CTool) detect() *ToolResult { } if len(matches) == 0 { - return SilentResult("No I2C buses found. You may need to:\n1. Load the i2c-dev module: modprobe i2c-dev\n2. Check that I2C is enabled in device tree\n3. Configure pinmux for your board (see hardware skill)") + return SilentResult( + "No I2C buses found. You may need to:\n1. Load the i2c-dev module: modprobe i2c-dev\n2. Check that I2C is enabled in device tree\n3. Configure pinmux for your board (see hardware skill)", + ) } type busInfo struct { @@ -128,7 +130,7 @@ func isValidBusID(id string) bool { // parseI2CAddress extracts and validates an I2C address from args // //nolint:unused // Used by i2c_linux.go -func parseI2CAddress(args map[string]interface{}) (int, *ToolResult) { +func parseI2CAddress(args map[string]any) (int, *ToolResult) { addrFloat, ok := args["address"].(float64) if !ok { return 0, ErrorResult("address is required (e.g. 0x38 for AHT20)") @@ -143,7 +145,7 @@ func parseI2CAddress(args map[string]interface{}) (int, *ToolResult) { // parseI2CBus extracts and validates an I2C bus from args // //nolint:unused // Used by i2c_linux.go -func parseI2CBus(args map[string]interface{}) (string, *ToolResult) { +func parseI2CBus(args map[string]any) (string, *ToolResult) { bus, ok := args["bus"].(string) if !ok || bus == "" { return "", ErrorResult("bus is required (e.g. \"1\" for /dev/i2c-1)") diff --git a/pkg/tools/spi.go b/pkg/tools/spi.go index 311a322e7..0ca17e84f 100644 --- a/pkg/tools/spi.go +++ b/pkg/tools/spi.go @@ -97,7 +97,9 @@ func (t *SPITool) list() *ToolResult { } if len(matches) == 0 { - return SilentResult("No SPI devices found. You may need to:\n1. Enable SPI in device tree\n2. Configure pinmux for your board (see hardware skill)\n3. Check that spidev module is loaded") + return SilentResult( + "No SPI devices found. You may need to:\n1. Enable SPI in device tree\n2. Configure pinmux for your board (see hardware skill)\n3. Check that spidev module is loaded", + ) } type devInfo struct { @@ -122,7 +124,7 @@ func (t *SPITool) list() *ToolResult { // parseSPIArgs extracts and validates common SPI parameters // //nolint:unused // Used by spi_linux.go -func parseSPIArgs(args map[string]interface{}) (device string, speed uint32, mode uint8, bits uint8, errMsg string) { +func parseSPIArgs(args map[string]any) (device string, speed uint32, mode uint8, bits uint8, errMsg string) { dev, ok := args["device"].(string) if !ok || dev == "" { return "", 0, 0, 0, "device is required (e.g. \"2.0\" for /dev/spidev2.0)"