diff --git a/platforms/digispark/digispark_adaptor.go b/platforms/digispark/digispark_adaptor.go index d382a06c..f2fcaf54 100644 --- a/platforms/digispark/digispark_adaptor.go +++ b/platforms/digispark/digispark_adaptor.go @@ -38,15 +38,13 @@ func (d *Adaptor) Name() string { return d.name } func (d *Adaptor) SetName(n string) { d.name = n } // Connect starts a connection to the digispark -func (d *Adaptor) Connect() (errs []error) { - if err := d.connect(d); err != nil { - return []error{err} - } +func (d *Adaptor) Connect() (err error) { + err = d.connect(d) return } // Finalize implements the Adaptor interface -func (d *Adaptor) Finalize() (errs []error) { return } +func (d *Adaptor) Finalize() (err error) { return } // DigitalWrite writes a value to the pin. Acceptable values are 1 or 0. func (d *Adaptor) DigitalWrite(pin string, level byte) (err error) { diff --git a/platforms/digispark/digispark_adaptor_test.go b/platforms/digispark/digispark_adaptor_test.go index 9e1d27a4..1f54fa58 100644 --- a/platforms/digispark/digispark_adaptor_test.go +++ b/platforms/digispark/digispark_adaptor_test.go @@ -72,15 +72,15 @@ func initTestAdaptor() *Adaptor { func TestAdaptorConnect(t *testing.T) { a := NewAdaptor() - gobottest.Assert(t, a.Connect()[0], ErrConnection) + gobottest.Assert(t, a.Connect(), ErrConnection) a = initTestAdaptor() - gobottest.Assert(t, len(a.Connect()), 0) + gobottest.Assert(t, a.Connect(), nil) } func TestAdaptorFinalize(t *testing.T) { a := initTestAdaptor() - gobottest.Assert(t, len(a.Finalize()), 0) + gobottest.Assert(t, a.Finalize(), nil) } func TestAdaptorDigitalWrite(t *testing.T) {