Skip to content

Commit

Permalink
Minor lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gsexton committed Oct 26, 2024
1 parent 2cb4a06 commit fc5e68c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions max7219/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func Example() {
dev.SetGlyphs(max7219.CP437Glyphs, true)
dev.SetDecode(max7219.DecodeNone)
dev.ScrollChars([]byte("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 100*time.Millisecond)
} else {
dev.SetDecode(max7219.DecodeB)
}

// display a count
Expand Down
4 changes: 0 additions & 4 deletions max7219/max7219.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,6 @@ func (d *Dev) writeChars(bytes []byte) error {
copy(x, d.glyphs[0x20])
w[ix] = x
}
limit := len(bytes)
if limit > len(w) {
limit = len(w)
}
charPos := len(bytes) - 1
for ix := d.units - 1; ix >= 0 && charPos >= 0; ix-- {
w[ix] = d.glyphs[bytes[charPos]]
Expand Down
4 changes: 2 additions & 2 deletions max7219/max7219_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ func TestCommand(t *testing.T) {
defer pb.Close()
record := &spitest.Record{}

dev, err := NewSPI(record, 4, 8)
dev, _ := NewSPI(record, 4, 8)
record.Ops = make([]conntest.IO, 0)
err = dev.SetIntensity(0x0b)
err := dev.SetIntensity(0x0b)

if err != nil {
t.Error(err)
Expand Down

0 comments on commit fc5e68c

Please sign in to comment.