From f4e4334cc1e7e9970cce38cd1d9aefc243db2e0f Mon Sep 17 00:00:00 2001 From: George Sexton Date: Wed, 12 Feb 2025 14:02:55 -0700 Subject: [PATCH] Fix lint errors --- mcp23xxx/doc.go | 2 +- mcp23xxx/group.go | 3 +++ mcp23xxx/group_test.go | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mcp23xxx/doc.go b/mcp23xxx/doc.go index 34d44dd..399280b 100644 --- a/mcp23xxx/doc.go +++ b/mcp23xxx/doc.go @@ -3,7 +3,7 @@ // that can be found in the LICENSE file. // Package mcp23xxx provides drivers for the MCP23XXX family of GPIO expanders. -// It's availble with either I2C or SPI interfaces in 8 and 16 bit variants. +// It's available with either I2C or SPI interfaces in 8 and 16 bit variants. // Additionally, variants are available that have Open-Drain outputs. // // # Datasheet diff --git a/mcp23xxx/group.go b/mcp23xxx/group.go index cf9706d..f7ac612 100644 --- a/mcp23xxx/group.go +++ b/mcp23xxx/group.go @@ -115,6 +115,9 @@ func (pg *pinGroup) Out(value, mask gpio.GPIOValue) error { // Read the current value currentValue, err := port.olat.readValue(true) + if err != nil { + return err + } // Apply the mask to clear bits we're writing. currentValue &= (0xff ^ wrMask) // Or the value with the bits to modify diff --git a/mcp23xxx/group_test.go b/mcp23xxx/group_test.go index 339dd05..323e072 100644 --- a/mcp23xxx/group_test.go +++ b/mcp23xxx/group_test.go @@ -98,9 +98,7 @@ func TestReadWrite(t *testing.T) { // For this test, write to the pins individually, and then // confirm read on the other set works as expected. - x := gRead gRead = gOut - gOut = x t.Log(gRead) pinset := extender.Pins[0][:4] for i := range gpio.GPIOValue(16) {