Uploading CSV File as Spreadsheet and Modifying Permissions using Golang
This sample script is for uploading CSV file as Spreadsheet and modifying permissions using Golang.
I think that the detail information of google-api-go-client is a bit little. The sample scripts are so little. It retrieves most information from only godoc and GitHub. So I publish such sample scripts here. If this is useful for you, I’m glad.
Important points :
- Give mimeType of file that it wants to upload to
optionsofMedia(r io.Reader, options ...googleapi.MediaOption). - In order to give
options, usegoogleapi.ContentType(). - Give mimeType of file that it wants to convert, when it uploads it to Google Drive, to
fileofCreate(file *File). - In order to give
file, use&drive.File{}. - For installing permissions, use
&drive.Permission{}. Each parameter is the same to them for Python.
This sample script uses Quickstart. So in order to use this sample script, at first, please do Step 1 and Step 2 of the Quickstart.