*: Move state example to root package

Also updated it to use Connect instead of Open and Close.
This commit is contained in:
diamondburned 2023-08-24 22:39:41 -07:00
parent b1a54c0b41
commit 5e0d1cfe4a
No known key found for this signature in database
GPG Key ID: D78C4471CE776659
1 changed files with 2 additions and 8 deletions

View File

@ -1,4 +1,4 @@
package state_test
package arikawa_test
import (
"context"
@ -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)
}
}