Need to find out why GODEBUG is ignored. Trying on linux.
This commit is contained in:
parent
fd059ad3cf
commit
ca8f4e194f
2 changed files with 23 additions and 1 deletions
3
Makefile
3
Makefile
|
@ -45,3 +45,6 @@ cover_report:
|
|||
go tool cover -func=coverage.txt
|
||||
go tool cover -html=coverage.txt -o coverage.html
|
||||
open coverage.html
|
||||
|
||||
twitch_mock:
|
||||
go tool twitch-cli mock-api start -p 8081
|
||||
|
|
|
@ -2,16 +2,22 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/nicklaw5/helix/v2"
|
||||
)
|
||||
|
||||
|
||||
|
||||
func main() {
|
||||
debug := os.Getenv("GODEBUG")
|
||||
fmt.Printf("%v\n\n", debug)
|
||||
|
||||
client, err := helix.NewClient(&helix.Options{
|
||||
ClientID: "57116762594c61061237ed15fcdf0f",
|
||||
APIBaseURL: "http://127.0.0.1:8081/mock",
|
||||
AppAccessToken: "a2bc8f684ea663d",
|
||||
})
|
||||
|
||||
if err != nil { panic(err) }
|
||||
|
||||
resp, err := client.GetUsers(&helix.UsersParams{
|
||||
|
@ -26,6 +32,19 @@ func main() {
|
|||
fmt.Printf("Rate limit reset: %d\n\n", resp.GetRateLimitReset())
|
||||
|
||||
for _, user := range resp.Data.Users{
|
||||
fmt.Printf("ID: %s Name: %s", user.ID, user.DisplayName)
|
||||
fmt.Printf("ID: %s Name: %s\n", user.ID, user.DisplayName)
|
||||
}
|
||||
|
||||
event_resp, err := client.CreateEventSubSubscription(&helix.EventSubSubscription{
|
||||
Type: helix.EventSubTypeStreamOnline,
|
||||
Version: "1",
|
||||
Transport: helix.EventSubTransport{
|
||||
Method: "webhook",
|
||||
Callback: "https://fuckyou.com/follow",
|
||||
Secret: "s3cre7w0rd",
|
||||
},
|
||||
})
|
||||
if err != nil { panic(err) }
|
||||
|
||||
fmt.Printf("%+v\n", event_resp)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue