Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 8f1af18

Browse files
Update code to use newer oauth2.go file
1 parent d4c68cb commit 8f1af18

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

go/upload_video.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ func main() {
2626
log.Fatalf("You must provide a filename of a video file to upload")
2727
}
2828

29-
client, err := buildOAuthHTTPClient(youtube.YoutubeUploadScope)
30-
if err != nil {
31-
log.Fatalf("Error building OAuth client: %v", err)
32-
}
29+
client := getClient(youtube.YoutubeUploadScope)
3330

3431
service, err := youtube.New(client)
3532
if err != nil {
@@ -59,8 +56,6 @@ func main() {
5956
}
6057

6158
response, err := call.Media(file).Do()
62-
if err != nil {
63-
log.Fatalf("Error making YouTube API call: %v", err)
64-
}
59+
handleError(err, "")
6560
fmt.Printf("Upload successful! Video ID: %v\n", response.Id)
6661
}

0 commit comments

Comments
 (0)