1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-20 11:37:56 +00:00

*: 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

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)
}
}