Skip to content

Commit

Permalink
Refactor TestAdaptorDigitalPinConcurrency test
Browse files Browse the repository at this point in the history
  • Loading branch information
muehlburger authored Dec 21, 2017
1 parent 6fb9c39 commit 5ee0569
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions platforms/raspi/raspi_adaptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ func TestAdaptorDigitalPinConcurrency(t *testing.T) {

a := initTestAdaptor()
var wg sync.WaitGroup
wg.Add(20)

for i := 0; i < 20; i++ {
wg.Add(1)
pinAsString := strconv.Itoa(i)
go func() {
go func(pin string) {
defer wg.Done()
a.DigitalPin(pinAsString, sysfs.IN)
}()
a.DigitalPin(pin, sysfs.IN)
}(pinAsString)
}

wg.Wait()
Expand Down

0 comments on commit 5ee0569

Please sign in to comment.