From 41e667c14f238f3fce3abe8a22c96f7d8b970ed4 Mon Sep 17 00:00:00 2001 From: Audrius Paskevicius <42367604+audrius-paskevicius@users.noreply.github.com> Date: Mon, 10 May 2021 08:42:41 +0200 Subject: [PATCH] Update ds248x.go --- ds248x/ds248x.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ds248x/ds248x.go b/ds248x/ds248x.go index d96b623..11e52ab 100644 --- a/ds248x/ds248x.go +++ b/ds248x/ds248x.go @@ -179,20 +179,20 @@ func (d *Dev) ChannelSelect(ch int) error { switch d.isDS248x { case isDS2482x800: if ch < 0 || ch > 7 { - return fmt.Errorf("%s: error while selecting channel: %s", d.String(), errors.New("channel out of range 0...7")) + return fmt.Errorf("%s: channel out of range 0...7", d.String()) } buf := []byte{cmdChannelSelect, cscw[ch]} if err := d.i2c.Tx(buf, nil); err != nil { - return fmt.Errorf("%s: error while selecting channel: %s", d.String(), err) + return fmt.Errorf("%s: error: %s", d.String(), err) } return nil case isDS2482x100, isDS2483: if ch != 0 { - return fmt.Errorf("%s: error while selecting channel: %s", d.String(), errors.New("invalid channel")) + return fmt.Errorf("%s: invalid channel", d.String()) } return nil default: - return fmt.Errorf("ds248x: error while selecting channel: %s", errors.New("wrong chip")) + return fmt.Errorf("ds248x: wrong chip") } }