Skip to content

Commit

Permalink
fixed example build for go < 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
esiqveland committed May 26, 2024
1 parent 01c481f commit 4b61129
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ func runMain() error {
}
n.SetUrgency(notify.UrgencyCritical)

counter := &atomic.Int32{}
counter := int32(0)
// Listen for actions invoked!
onAction := func(action *notify.ActionInvokedSignal) {
counter.Add(1)
atomic.AddInt32(&counter, 1)
log.Printf("ActionInvoked: %v Key: %v", action.ID, action.ActionKey)
wg.Done()
}

onClosed := func(closer *notify.NotificationClosedSignal) {
counter.Add(1)
atomic.AddInt32(&counter, 1)
log.Printf("NotificationClosed: %v Reason: %v", closer.ID, closer.Reason)
wg.Done()
}
Expand Down Expand Up @@ -128,7 +128,7 @@ func runMain() error {
wg.Add(2)
wg.Wait()

log.Printf("total signal count received: %d", counter.Load())
log.Printf("total signal count received: %d", atomic.LoadInt32(&counter))

return nil
}
Expand Down

0 comments on commit 4b61129

Please sign in to comment.