Skip to content

Commit

Permalink
Switch drive.go to v3 API (#1334)
Browse files Browse the repository at this point in the history
  • Loading branch information
bboissin authored Jan 14, 2022
1 parent 33250c0 commit f3223f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"net/http"
"os"

drive "google.golang.org/api/drive/v2"
drive "google.golang.org/api/drive/v3"
)

func init() {
registerDemo("drive", drive.DriveScope, driveMain)
registerDemo("drive", drive.DriveFileScope, driveMain)
}

func driveMain(client *http.Client, argv []string) {
Expand All @@ -34,6 +34,6 @@ func driveMain(client *http.Client, argv []string) {
if err != nil {
log.Fatalf("error opening %q: %v", filename, err)
}
driveFile, err := service.Files.Insert(&drive.File{Title: filename}).Media(goFile).Do()
driveFile, err := service.Files.Create(&drive.File{Name: filename}).Media(goFile).Do()
log.Printf("Got drive.File, err: %#v, %v", driveFile, err)
}

0 comments on commit f3223f8

Please sign in to comment.