Skip to content

Commit

Permalink
*: Move state example to root package
Browse files Browse the repository at this point in the history
Also updated it to use Connect instead of Open and Close.
  • Loading branch information
diamondburned committed Aug 25, 2023
1 parent b1a54c0 commit 5e0d1cf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions state/state_example_test.go → arikawa_example_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package state_test
package arikawa_test

import (
"context"
Expand All @@ -20,13 +20,7 @@ func Example() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

if err := s.Open(ctx); err != nil {
if err := s.Connect(ctx); err != nil {
log.Println("cannot open:", err)
}

<-ctx.Done() // block until Ctrl+C

if err := s.Close(); err != nil {
log.Println("cannot close:", err)
}
}

0 comments on commit 5e0d1cf

Please sign in to comment.