Skip to content

Commit

Permalink
Run go fmt across all files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklaw5 committed Jun 3, 2021
1 parent b93c4fc commit ffa103c
Show file tree
Hide file tree
Showing 31 changed files with 206 additions and 219 deletions.
2 changes: 1 addition & 1 deletion ads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestClient_StartCommercial(t *testing.T) {

}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
4 changes: 2 additions & 2 deletions analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestGetExtensionAnalytics(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestGetGameAnalytics(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
2 changes: 1 addition & 1 deletion authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func TestValidateToken(t *testing.T) {
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
newMockHandler(0, "", nil),
},
},
}
c := &Client{
opts: options,
Expand Down
4 changes: 2 additions & 2 deletions bits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestClient_GetBitsLeaderboard(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down Expand Up @@ -619,7 +619,7 @@ func TestClient_GetCheermotes(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
2 changes: 0 additions & 2 deletions channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,3 @@ func (c *Client) EditChannelInformation(params *EditChannelInformationParams) (*

return channels, nil
}


4 changes: 2 additions & 2 deletions channels_editors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package helix

// ChannelEditorParams ...
type ChannelEditorsParams struct {
BroadcasterID string `query:"broadcaster_id"`
BroadcasterID string `query:"broadcaster_id"`
}

// ManyChannelEditors ...
type ManyChannelEditors struct {
ChannelEditors [] ChannelEditor `json:"data"`
ChannelEditors []ChannelEditor `json:"data"`
}

// ChannelEditor
Expand Down
2 changes: 1 addition & 1 deletion channels_editors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestGetChannelEditors(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
16 changes: 8 additions & 8 deletions channels_points_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ func TestCreateCustomReward(t *testing.T) {
t.Parallel()

testCases := []struct {
statusCode int
options *Options
params *ChannelCustomRewardsParams
respBody string
statusCode int
options *Options
params *ChannelCustomRewardsParams
respBody string
}{
{
http.StatusOK,
&Options{ClientID: "my-client-id"},
&ChannelCustomRewardsParams{
BroadcasterID : "145328278",
Title : "game analysis 1v1",
Cost : 50000,
BroadcasterID: "145328278",
Title: "game analysis 1v1",
Cost: 50000,
},
`{"data": [{"broadcaster_name": "torpedo09","broadcaster_login": "torpedo09","broadcaster_id": "145328278","id": "afaa7e34-6b17-49f0-a19a-d1e76eaaf673","image": null,"background_color": "#00E5CB","is_enabled": true,"cost": 50000,"title": "game analysis 1v1","prompt": "","is_user_input_required": false,"max_per_stream_setting": {"is_enabled": false,"max_per_stream": 0},"max_per_user_per_stream_setting": {"is_enabled": false,"max_per_user_per_stream": 0},"global_cooldown_setting": {"is_enabled": false,"global_cooldown_seconds": 0},"is_paused": false,"is_in_stock": true,"default_image": {"url_1x": "https://static-cdn.jtvnw.net/custom-reward-images/default-1.png","url_2x": "https://static-cdn.jtvnw.net/custom-reward-images/default-2.png","url_4x": "https://static-cdn.jtvnw.net/custom-reward-images/default-4.png"},"should_redemptions_skip_request_queue": false,"redemptions_redeemed_current_stream": null,"cooldown_expires_at": null}]}`,
},
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestCreateCustomReward(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
46 changes: 23 additions & 23 deletions channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func TestSearchChannels(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down Expand Up @@ -149,12 +149,12 @@ func TestGetChannelInformation(t *testing.T) {
`{"data":[{"broadcaster_id":"44445592","broadcaster_login":"pokimane","broadcaster_name":"pokimane","broadcaster_language":"en","game_id":"509658","game_name":"Just Chatting","title":"See you Wednesday 8am for Among Us ^_^"}]}`,
[]ChannelInformation{
{
BroadcasterID: "44445592",
BroadcasterName: "pokimane",
BroadcasterLanguage: "en",
GameID: "509658",
GameName: "Just Chatting",
Title: "See you Wednesday 8am for Among Us ^_^",
BroadcasterID: "44445592",
BroadcasterName: "pokimane",
BroadcasterLanguage: "en",
GameID: "509658",
GameName: "Just Chatting",
Title: "See you Wednesday 8am for Among Us ^_^",
},
},
},
Expand Down Expand Up @@ -217,7 +217,7 @@ func TestGetChannelInformation(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand All @@ -242,42 +242,42 @@ func TestEditChannelInformation(t *testing.T) {
t.Parallel()

testCases := []struct {
statusCode int
options *Options
params *EditChannelInformationParams
respBody string
statusCode int
options *Options
params *EditChannelInformationParams
respBody string
}{
{
http.StatusOK,
&Options{ClientID: "my-client-id"},
&EditChannelInformationParams{
BroadcasterID: "123",
GameID: "456",
BroadcasterID: "123",
GameID: "456",
BroadcasterLanguage: "en",
Title: "Test title",
Title: "Test title",
},
`{"data":[{"game_id":"498566","broadcaster_language":"en","title":"Test Twitch API"}]}`,
},
{
http.StatusBadRequest,
&Options{ClientID: "my-client-id"},
&EditChannelInformationParams{
BroadcasterID: "789",
GameID: "456",
BroadcasterID: "789",
GameID: "456",
BroadcasterLanguage: "en",
Title: "Test title",
Delay: 3,
Title: "Test title",
Delay: 3,
},
`{"error":"Bad Request","status":400,"message":"the broadcaster is not partnered, failed to set delay"}`,
},
{
http.StatusBadRequest,
&Options{ClientID: "my-client-id"},
&EditChannelInformationParams{
BroadcasterID: "789",
GameID: "-1",
BroadcasterID: "789",
GameID: "-1",
BroadcasterLanguage: "en",
Title: "Test title",
Title: "Test title",
},
`{"error":"Bad Request","status":400,"message":"invalid game_id"}`,
},
Expand Down Expand Up @@ -310,7 +310,7 @@ func TestEditChannelInformation(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
6 changes: 3 additions & 3 deletions chat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ func TestGetGlobalChatBadges(t *testing.T) {
t.Parallel()

testCases := []struct {
statusCode int
options *Options
respBody string
statusCode int
options *Options
respBody string
}{
{
http.StatusUnauthorized,
Expand Down
30 changes: 15 additions & 15 deletions clips.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package helix

// Clip ...
type Clip struct {
ID string `json:"id"`
URL string `json:"url"`
EmbedURL string `json:"embed_url"`
BroadcasterID string `json:"broadcaster_id"`
BroadcasterName string `json:"broadcaster_name"`
CreatorID string `json:"creator_id"`
CreatorName string `json:"creator_name"`
Duration float64 `json:"duration"`
VideoID string `json:"video_id"`
GameID string `json:"game_id"`
Language string `json:"language"`
Title string `json:"title"`
ViewCount int `json:"view_count"`
CreatedAt string `json:"created_at"`
ThumbnailURL string `json:"thumbnail_url"`
ID string `json:"id"`
URL string `json:"url"`
EmbedURL string `json:"embed_url"`
BroadcasterID string `json:"broadcaster_id"`
BroadcasterName string `json:"broadcaster_name"`
CreatorID string `json:"creator_id"`
CreatorName string `json:"creator_name"`
Duration float64 `json:"duration"`
VideoID string `json:"video_id"`
GameID string `json:"game_id"`
Language string `json:"language"`
Title string `json:"title"`
ViewCount int `json:"view_count"`
CreatedAt string `json:"created_at"`
ThumbnailURL string `json:"thumbnail_url"`
}

// ManyClips ...
Expand Down
2 changes: 1 addition & 1 deletion drops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestGetDropsEntitlements(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
2 changes: 1 addition & 1 deletion entitlement_codes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestClient_GetEntitlementCodeStatus(t *testing.T) {

}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
49 changes: 24 additions & 25 deletions eventsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,34 +222,34 @@ type EventSubChannelRaidEvent struct {

// Data for a channel poll begin event
type EventSubChannelPollBeginEvent struct {
ID string `json:"id"`
BroadcasterUserID string `json:"broadcaster_user_id"`
BroadcasterUserLogin string `json:"broadcaster_user_login"`
BroadcasterUserName string `json:"broadcaster_user_name"`
Title string `json:"title"`
Choices []PollChoice `json:"choices"`
BitsVoting EventSubBitVoting `json:"bits_voting"`
ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"`
StartedAt Time `json:"started_at"`
EndsAt Time `json:"ends_at"`
ID string `json:"id"`
BroadcasterUserID string `json:"broadcaster_user_id"`
BroadcasterUserLogin string `json:"broadcaster_user_login"`
BroadcasterUserName string `json:"broadcaster_user_name"`
Title string `json:"title"`
Choices []PollChoice `json:"choices"`
BitsVoting EventSubBitVoting `json:"bits_voting"`
ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"`
StartedAt Time `json:"started_at"`
EndsAt Time `json:"ends_at"`
}

// Data for a channel poll progress event, it's the same as the channel poll begin event
type EventSubChannelPollProgressEvent = EventSubChannelPollBeginEvent

// Data for a channel poll end event
type EventSubChannelPollEndEvent struct {
ID string `json:"id"`
BroadcasterUserID string `json:"broadcaster_user_id"`
BroadcasterUserLogin string `json:"broadcaster_user_login"`
BroadcasterUserName string `json:"broadcaster_user_name"`
Title string `json:"title"`
Choices []PollChoice `json:"choices"`
BitsVoting EventSubBitVoting `json:"bits_voting"`
ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"`
Status string `json:"status"`
StartedAt Time `json:"started_at"`
EndedAt Time `json:"ended_at"`
ID string `json:"id"`
BroadcasterUserID string `json:"broadcaster_user_id"`
BroadcasterUserLogin string `json:"broadcaster_user_login"`
BroadcasterUserName string `json:"broadcaster_user_name"`
Title string `json:"title"`
Choices []PollChoice `json:"choices"`
BitsVoting EventSubBitVoting `json:"bits_voting"`
ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"`
Status string `json:"status"`
StartedAt Time `json:"started_at"`
EndedAt Time `json:"ended_at"`
}

// EventSubBitVoting ...
Expand All @@ -261,7 +261,6 @@ type EventSubBitVoting struct {
// ChannelPointsVoting ...
type EventSubChannelPointsVoting = EventSubBitVoting


// Data for a channel points custom reward notification
type EventSubChannelPointsCustomRewardEvent struct {
ID string `json:"id"`
Expand Down Expand Up @@ -505,10 +504,10 @@ func (c *Client) GetEventSubSubscriptions(params *EventSubSubscriptionsParams) (

eventSubs := &EventSubSubscriptionsResponse{}
resp.HydrateResponseCommon(&eventSubs.ResponseCommon)
eventSubs.Data.TotalCost = resp.Data.(*ManyEventSubSubscriptions).TotalCost
eventSubs.Data.MaxTotalCost = resp.Data.(*ManyEventSubSubscriptions).MaxTotalCost
eventSubs.Data.TotalCost = resp.Data.(*ManyEventSubSubscriptions).TotalCost
eventSubs.Data.MaxTotalCost = resp.Data.(*ManyEventSubSubscriptions).MaxTotalCost
eventSubs.Data.EventSubSubscriptions = resp.Data.(*ManyEventSubSubscriptions).EventSubSubscriptions
eventSubs.Data.Pagination = resp.Data.(*ManyEventSubSubscriptions).Pagination
eventSubs.Data.Pagination = resp.Data.(*ManyEventSubSubscriptions).Pagination

return eventSubs, nil
}
Expand Down
4 changes: 2 additions & 2 deletions eventsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestGetEventSubSubscriptions(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestRemoveEventSubSubscriptions(t *testing.T) {
}
}

// Test with HTTP Failure
// Test with HTTP Failure
options := &Options{
ClientID: "my-client-id",
HTTPClient: &badMockHTTPClient{
Expand Down
Loading

0 comments on commit ffa103c

Please sign in to comment.