Giter VIP home page Giter VIP logo

go-samples's People

Contributors

asrivas avatar asrivas-devrel avatar clesleycode avatar codyoss avatar dastergon avatar googleworkspace-bot avatar grant avatar henry-jackson avatar hp-huang-tw avatar jpoehnelt avatar jsmeredith avatar renovate[bot] avatar sqrrrl avatar v1ctor avatar vinay-google avatar y-yagi avatar zalgonoise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-samples's Issues

Credentials problem

The Go documentation is incomplete and need help urgently on the step to create new credentials.json which it has additional missing key but I tried to generate a private JSON in Google API console is confusing that I'm stuck with no proper guidance.
https://developers.google.com/sheets/api/quickstart/go?authuser=2

Someone has changed the credential requirements without inform anyone and create all the mess.

Go code for Sheetv4 is running on web server.

Apps Script API - unable to use API Explorer

Expected Behavior

The Apps Script API provides a scripts.run method that remotely executes a specified Apps Script function.

Actual Behavior

The Apps Script API is either not working, or not properly documented enough for me to be able to use within a reasonable amount of time and effort.

Steps to Reproduce the Problem

  1. Go to https://script.google.com/home/my
  2. Click "+ New Script"
  3. Enter project name: "TestScript"
  4. Set the file "Code.gs" to the following:
    function setProp() { var props = PropertiesService.getScriptProperties().setProperty('testKey', 'testValue'); } function clearProp() { PropertiesService.getScriptProperties().deleteAllProperties(); } function testProp() { Logger.log('Props: ' + JSON.stringify(PropertiesService.getScriptProperties().getProperties(), null, 5)); }
  5. Quickly test the code by running setProp, then testProp, then press CTRL+ENTER to see the following:
    Props: { "testKey": "testValue" }
  6. Clear the property by running clearProp, the testProp, and pressing CTRL+ENTER again. Should see:
    Props: {}
  7. Click Publish => Deploy as API Executable
  8. Set the version name to "MyVersion" - leave it as accessible only to "myself"
  9. Click "Close" on the new modal window that pops up
  10. Click Resources => Cloud Platform Project
  11. Click on the link immediately following the text "This script is currently associated with project:"
  12. On the left side-panel, click "APIs and Services" => Library
  13. In the search box, type "Script", and select "Apps Script API" from the results
  14. Click Enable
  15. Click "Try in API Explorer"
  16. Click script.scripts.run
  17. Put the script ID into the scriptId box (in URL of script editor page, or in File => Project Properties)
  18. Click on the Request box, and from the "-- add a property --" selector, select "function"
  19. Enter "setProp" as the function name
  20. Click on "Authorize and Execute"
  21. Agree to all the automatically selected scopes - click "Authorize and Execute"
  22. Choose the same account that created the script project
  23. The response is:

403 cache-control: private content-encoding: gzip content-length: 128 content-type: application/json; charset=UTF-8 date: Sun, 10 Mar 2019 01:58:03 GMT server: ESF vary: Origin, X-Origin, Referer { "error": { "code": 403, "message": "The caller does not have permission", "status": "PERMISSION_DENIED" } }

I have tried the following:

  1. Adding more scopes to the code and authorizations
  2. Setting devMode to true
  3. Deploying from manifest file
  4. Setting the API accessibility to "Anyone"
  5. Running from .NET

In each case, I get the same 403 error.

Specifications

None applicable

Googlesheets Quickstart example unreachable in localhost

Expected Behavior

From the example provided in - https://developers.google.com/sheets/api/quickstart/go#run_the_sample , the expected behaviour upon running the app first time is:

In your browser, go to http://localhost:8000.

The first time you run the sample, it prompts you to authorize access:

If you're not already signed in to your Google Account, you're prompted to sign in. If you're signed in to multiple accounts, select one account to use for authorization.
Click Accept.
Copy the code from the browser, paste it into the command-line prompt, and press Enter.
Authorization information is stored in the file system, so the next time you run the sample code, you aren't prompted for authorization.

Actual Behavior

nothing running in localhost

curl http://localhost:8000                                                                                                                                       7 ↵ ryemane@robel-cs
curl: (7) Failed to connect to localhost port 8000 after 4 ms: Connection refused

image

and when following the link that the app suggest to visit i.e.

go run quickstart2.go                                                                                                                               1 ↵ ryemane@robel-cs
Go to the following link in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=372148273502-3kj1acfo674on8q2hodqdbbnv67vvn2r.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets.readonly&state=state-token

I get asked that the app wants to access my google account but when I allow it, it fails to continue and site is unrechable
image

Steps to Reproduce the Problem

  1. Strictly followed the example here: https://developers.google.com/sheets/api/quickstart/go

Specifications

  • Go version (go version): go version go1.19.5 darwin/arm64
  • OS (Mac/Linux/Windows) Mac

go vet passes

Expected Behavior

go vet ./... produces no error.

Actual Behavior

go vet produces errors.

Golang Gmail Api

Error 500: Requested Resource Too Large to Return, responseTooLarge

Expected Behavior

Data in G Suite Admin API should return JSON response

Actual Behavior

  • "Unable to retrieve list of activities"
  • "Error 500: Requested Resource Too Large to Return, responseTooLarge"

This condition is also handled in https://github.com/gsuitedevs/go-samples/blob/master/drive/activity-v2/quickstart/quickstart.go line 213

I'm unable to replicate the scenario, can you please tell me a solution.

Specifications

  • Go version (go version) : 1.12.9
  • OS (Mac/Linux/Windows) : Windows

Admin-sdk Error 400: Bad Request, badRequest

Expected Behavior

I'm trying to use this example:
https://developers.google.com/admin-sdk/directory/v1/quickstart/go
I expect to see a list of users names and email addresses from my domain

Actual Behavior

I get an error from this line:
https://github.com/gsuitedevs/go-samples/blob/master/admin_sdk/directory/quickstart.go#L104

Unable to retrieve users in domain: googleapi: Error 400: Bad Request, badRequest

I am using ... .Customer("<my-domain>") ..., there are several users in the org that have email addresses in that domain.

Steps to Reproduce the Problem

  1. Followed the G Suite wide delegation guide to get client credentials/private key:
    https://developers.google.com/admin-sdk/directory/v1/guides/delegation
  2. Added the service requests to get domain users
  3. Compile succeeds and run => error.

Specifications

  • go1.10.2
  • macOs 10.13.6

"No required module provides package" errors

Expected Behavior

quickstart.go runs as expected

Actual Behavior

quickstart.go:11:9: no required module provides package golang.org/x/net/context: go.mod file not found in current directory or any parent directory; see 'go help modules'
quickstart.go:12:9: no required module provides package golang.org/x/oauth2: go.mod file not found in current directory or any parent directory; see 'go help modules'
quickstart.go:13:9: no required module provides package golang.org/x/oauth2/google: go.mod file not found in current directory or any parent directory; see 'go help modules'
quickstart.go:14:9: no required module provides package google.golang.org/api/drive/v3: go.mod file not found in current directory or any parent directory; see 'go help modules'

Steps to Reproduce the Problem

  1. Follow the instructions at https://developers.google.com/drive/api/v3/quickstart/go

Specifications

  • 1.16.4
  • Windows 10

how to send html

Expected Behavior

success send

Actual Behavior

googleapi: Error 400: Recipient address required, invalidArgument

when I don't set message.Raw, response is '... raw required, invalidArgument'

Steps to Reproduce the Problem

my code :

       srv, err := gmail.New(client)
   if err != nil {
   	log.Fatalf("Unable to retrieve Gmail client: %v", err)
   }
   var message gmail.Message
   var gmailheader []*gmail.MessagePartHeader
   to := gmail.MessagePartHeader{}
   to.Name = "To"
   to.Value = "***@***"
   gmailheader = append(gmailheader, &to)
   from := gmail.MessagePartHeader{}
   from.Name = "From"
   from.Value = "me"
   gmailheader = append(gmailheader, &from)
   subject := gmail.MessagePartHeader{}
   subject.Name = "Subject"
   subject.Value = "Testing"
   gmailheader = append(gmailheader, &subject)


   messagePartBody := new(gmail.MessagePartBody)
   messagePart := new(gmail.MessagePart)
   content := `<a href="google.com" target="_blank">google</ a>`
   html := base64.StdEncoding.EncodeToString([]byte(content))
   html = strings.Replace(html, "/", "_", -1)
   html = strings.Replace(html, "+", "-", -1)
   html = strings.Replace(html, "=", "", -1)
   messagePartBody.Data =  html
   messagePart.MimeType = "text/html"
   messagePart.Body = messagePartBody
   messagePart.Headers = gmailheader
   message.Payload = messagePart

   bytebody,err := messagePart.MarshalJSON()
   if err !=nil{
   	log.Fatal(err)
   }

   message.Raw =  base64.StdEncoding.EncodeToString(bytebody)

   _, err = srv.Users.Messages.Send("me", &message).Do()
   if err != nil {
   	log.Fatalf("Unable to send. %v", err)
   }

Specifications

  • Go version (1.10.3)
  • OS (Linux)

Error 400: personFields mask is required.

Expected Behavior

First time run, unclear as to the specific behavior I am supposed to see, but I believe the error is not one that I am expected to see.

Actual Behavior

2018/10/10 08:47:50 Unable to retrieve people. googleapi: Error 400: personFields mask is required. Please specify one or more validpaths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/get., badRequest
exit status 1

Steps to Reproduce the Problem

  1. Followed the details as per outlined on https://developers.google.com/people/quickstart/go
  2. Initially was prompted to log into my Google account and authorize. To which I received a token, that I pasted into the console screen.
  3. Console processed the token, and created token.json file.
  4. Error (as per above) appeared.

Specifications

  • Go version (go version)
    go version go1.11.1 darwin/amd64
  • OS (Mac)
    Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

Golang & Google Spreadsheet API V4 - Unable to read a sheet

I've been following the https://developers.google.com/sheets/api/quickstart/go but I couldn't make it work. In fact, I am getting all the time this error:

2019/01/20 14:39:00 Unable to retrieve data from sheet: Get https://sheets.googleapis.com/v4/spreadsheets/[..............]?alt=json&prettyPrint=false: oauth2: cannot fetch token: 401 Unauthorized
Response: {
    "error": "unauthorized_client",
    "error_description": "Unauthorized"
}

I first changed the spreadsheetId and the readRange of the quickstart:

// Prints the names and majors of students in a sample spreadsheet:
// https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
spreadsheetId := "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
readRange := "Class Data!A2:E"
resp, err := srv.Spreadsheets.Values.Get(spreadsheetId, readRange).Do()
if err != nil {
	log.Fatalf("Unable to retrieve data from sheet: %v", err)
}

if len(resp.Values) == 0 {
	fmt.Println("No data found.")
} else {
	fmt.Println("Name, Major:")
	for _, row := range resp.Values {
	// Print columns A and E, which correspond to indices 0 and 4.
		fmt.Printf("%s, %s\n", row[0], row[4])
	}
}

Because, since I have already implemented the Google Drive API V3, I put an id of a spreadsheet I have (and used the credentials.json of the account that created this spreadsheet)

However, I am still getting this error, any idea why?

Thanks for any help

PS: Original link: https://stackoverflow.com/questions/54280274/golang-google-spreadsheet-api-v4-unable-to-read-a-sheet

adminaccess to read all metadata even with accessRole:freeBusyReader

Expected Behavior

given admin access with Oauth2 scope: "https://www.googleapis.com/auth/calendar"
i should be able to see calendar event attendees even if user sets event visibility:private

Actual Behavior

i see "events" schema data, but no admin visibility to see attendees.
{ "accessRole": "freeBusyReader", "etag": "\"p32ke99md......\"", "items": [ { "end": { "dateTime": "2017-08-31T17:30:00-07:00" }, "etag": "\"30081064......\"", "htmlLink": "https://www.google.com/calendar/event?eid=MGw3aWVz.....", "iCalUID": "[email protected]", "id": "0l7iesgjgpb.......", "kind": "calendar#event", "start": { "dateTime": "2017-08-31T15:30:00-07:00" }, "status": "confirmed", "updated": "2017-08-30T00:33:59.851Z", "visibility": "private" },

Steps to Reproduce the Problem

  1. used this code https://developers.google.com/calendar/quickstart/go
  2. enabled calendar api.
  3. used oauth2.0 client id json file (from gcp> api & services > credentials > oauth2.0 client id > downloaded file.
  4. worked with my gsuite team to use admin scope: "https://www.googleapis.com/auth/calendar" they videochat and showed me i have access to calendar API full read/write access with this exact scope.
  5. i can read all my own calendar data.
  6. when i read other users on my domain, who set visibility: public, i can see all data
  7. when i read other users on my domain, who set visibility: private, i see limited data. im specifically looking for events.Items[x].Attendees data.

Specifications

  • go version go1.12.1 darwin/amd64
  • OS Mac

don't get token

don't get token
Screen Shot 2563-10-05 at 11 05 17
from "https://oauth2.googleapis.com/token"

Go to the following link in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=851591631538-pl9nb3n05fvu8tamfbuvglf4d0l9iet1.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets.readonly&state=state-token
4/4wGMPRRuG3u8cHzDh-N6gH-QW7ZE17RJl23hkscryDjmQW7Ekcmvcxg

2020/10/05 03:31:45 Unable to retrieve token from web: %v Post "https://oauth2.googleapis.com/token": x509: certificate signed by unknown authority

Required redirect_uris is optional in GUI

Expected Behavior

In Step 4: Run the sample.
The credentials provided in the credentials.json file is correct according to the structs. And I get the message Go to the following link in your browser then type the authorization code:

Actual Behavior

In Step 4: Run the sample.
I run the project and get

$ go run quickstart.go
2018/11/10 23:01:12 Unable to parse client secret file to config: oauth2/google: missing redirect URL in the client_credentials.json
exit status 1

The parameter redirect_uris is required in the code but it is optional in the GUI.

Steps to Reproduce the Problem

  1. Copy the code into a go file.
  2. Run the code go run quickstart.go and get
2018/11/10 22:56:52 Unable to read client secret file: open credentials.json: no such file or directory
exit status 1
  1. Log into my google account and create a project without Authorized redirect URIs and Authorized JavaScript origins
  2. Download the json file.
  3. Move the json file next to quickstart.go
  4. Rename the file to credentials.json
  5. Run the code again go run quickstart.go
  6. I get 2018/11/10 23:01:12 Unable to parse client secret file to config: oauth2/google: missing redirect URL in the client_credentials.json exit status 1
  7. I then look into the json file less credentials.json. The parameters existing under web are client_id, project_id, auth_uri, token_uri, auth_provider_x509_cert_url and client_secret. No redirect_uris exists.

Specifications

  • Go version (go version go1.11 darwin/amd64)
  • OS (OSX 10.14.1)

$authCode = trim(fgets(STDIN)) return nothing

Expected Behavior

I do an example with php's language, it works until $authCode = trim(fgets(STDIN)); line and return nothing and i cannot know why it doesn't work, can you help me?

  • Go version (go version)
  • OS Linux

Feature Request: Manage Group members snippets

I would really appreciate some Golang snippets demonstrating manage-group-members operations, especially checking group membership, adding members to a group.

package google_groups_sync

import (
	"context"
	"io/ioutil"
	"log"
	"strings"
	"time"

	"github.com/dxe/adb/config"
	"github.com/dxe/adb/model"
	"github.com/jmoiron/sqlx"
	"github.com/pkg/errors"

	"golang.org/x/oauth2/google"
	admin "google.golang.org/api/admin/directory/v1"
)

func getAdminService() (*admin.Service, error) {
	key, err := ioutil.ReadFile(config.SyncMailingListsConfigFile)
	if err != nil {
		return nil, errors.Wrap(err, "Could not read google auth key")
	}
	oauthConfig, err := google.JWTConfigFromJSON(key, "https://www.googleapis.com/auth/admin.directory.group")
	if err != nil {
		return nil, errors.Wrap(err, "Could not read JWT config from google auth key")
	}
	oauthConfig.Subject = config.SyncMailingListsOauthSubject

	client := oauthConfig.Client(context.Background())
	adminService, err := admin.New(client)
	if err != nil {
		return nil, errors.Wrap(err, "Could not construct admin service")
	}

	return adminService, nil
}

func listMembers(adminService *admin.Service, groupEmail string) ([]string, error) {
	var memberEmails []string
	call := adminService.Members.List(groupEmail)
	err := call.Pages(context.Background(), func(members *admin.Members) error {
		for _, m := range members.Members {
			memberEmails = append(memberEmails, m.Email)
		}
		return nil
	})
	if err != nil {
		return nil, errors.Wrapf(err, "Could not page members for group %s", groupEmail)
	}
	return memberEmails, nil
}

func insertMember(adminService *admin.Service, groupEmail, memberEmail string) error {
	_, err := adminService.Members.Insert(groupEmail, &admin.Member{Email: memberEmail}).Do()
	return errors.Wrapf(err, "Could not insert member %s into group %s ", memberEmail, groupEmail)
}

func removeMember(adminService *admin.Service, groupEmail, memberEmail string) error {
	err := adminService.Members.Delete(groupEmail, memberEmail).Do()
	return errors.Wrapf(err, "Could not delete member %s from group %s", memberEmail, groupEmail)
}
// something something main mumble unit tests 

Getting Unauthorized

Expected Behavior

Show the mail labels

Actual Behavior

go run quickstart.go
2020/08/27 13:30:46 Unable to retrieve messages: Get https://gmail.googleapis.com/gmail/v1/users/me/messages?alt=json&prettyPrint=false&q=subject%3AUpdate+Your+Account: oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}
exit status 1

Steps to Reproduce the Problem

1.Created a gmail.Tried the steps in https://developers.google.com/gmail/api/quickstart/go
2.The script worked.
3.Created another gmail. Tried the same steps in https://developers.google.com/gmail/api/quickstart/go
4.Tried the script with new credentials.json.
5.Got error
2020/08/27 13:30:46 Unable to retrieve messages: Get https://gmail.googleapis.com/gmail/v1/users/me/messages?alt=json&prettyPrint=false&q=subject%3AUpdate+Your+Account: oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}
exit status 1

6.With the credential created in step #1, script is working.

Specifications

  • Go version (go version) go version go1.13 darwin/amd64
  • OS (Mac

Missing package cloud.google.com/go/compute/metadata

When running go run quickstart.go, it fails and returns: ../../../golang.org/x/oauth2/google/default.go:16:2: cannot find package "cloud.google.com/go/compute/metadata" in any of:
/usr/local/go/src/cloud.google.com/go/compute/metadata (from $GOROOT)
So then you need to run: go get -u cloud.google.com/go/compute/metadata

It would be great to have this step in the Go Quickstart Guide.

Unable to read client secret file: open credentials.json

Expected Behavior

The first time you run the sample, it will prompt you to authorize access:

Browse to the provided URL in your web browser.

If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.

Click the Accept button.
Copy the code you're given, paste it into the command-line prompt, and press Enter.

Actual Behavior

When I run go run quickstart.go, the error is Unable to read client secret file: open credentials.json.

Steps to Reproduce the Problem

  1. Write as described in the API developers documentation
  2. Run go run quickstart.go

Specifications

  • Go version -> go1.11.2
  • OS Linux

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

gomod
go.mod
  • github.com/stretchr/testify v1.7.0
  • golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8@d3ed0bb246c8
  • google.golang.org/api v0.64.0

  • Check this box to trigger a request for Renovate to run again on this repository

[SyncRepoSettings bot] - Invalid config file

Failed to validate the config schema at '.github/sync-repo-settings.yaml': [
{
"instancePath": "/permissionRules/1/permission",
"schemaPath": "#/properties/permissionRules/items/properties/permission/enum",
"keyword": "enum",
"params": {
"allowedValues": [
"pull",
"push",
"admin"
]
},
"message": "must be equal to one of the allowed values"
}
]

Schema can be found at https://github.com/googleapis/repo-automation-bots/blob/main/packages/sync-repo-settings/src/schema.json

Review Step 1: download credentials.json file

Expected Behavior

credentials.json file

Actual Behavior

How to download credentials.json ?

Steps to Reproduce the Problem

Step 1: Download credentials.json, how ? I'm not familiar with Google Console Manager, and on browser link dosen't work!

Specifications

  • Go version (go version)
  • OS (C#/Windows)

gmail quickstart.go will not retrieve a token

Expected Behavior

Following the gmail quickstart.go guide should produce a token.json file

Actual Behavior

The instructions ask to go to http://localhost:8000 which produces a site can't be reached dialog box

BTW - the quickstart.py works as expected. There seems to be something missing from the quickstart.go file if it really does need a webserver for localhost:8000.

Steps to Reproduce the Problem

  1. Follow the quickstart.go guide
  2. When the instructions ask to go to http://localhost:8000 you will get the can't be reached dialog box
    Screenshot from 2022-09-30 10-24-37

Screenshot from 2022-09-30 10-30-03

Specifications

  • Go version (go version) go version go1.19.1 linux/amd64
  • OS (Mac/Linux/Windows) Linux POP!_OS 22.04 LTS / 64-bit

token expired and refresh token is not set

Expected Behavior

load labels with go run quickstart

Actual Behavior

unable to retrieve labels: Get https://www.googleapis.com/gmail/v1/users/isomorphismes%20gmail.com/labels?alt=json&prettyPrint=false: oauth2: token expired and refresh token is not set
exit status 1

Steps to Reproduce the Problem

  1. copy the code
  2. click buttons to enable gmail api
  3. fix the misplaced if statement
  4. go run quickstart.go

Specifications

  • Go version (go version) 1.13.5 linux/386
  • OS (Mac/Linux/Windows) void linux

sheet/quickstart.go does not work when use "service account credential" token

Expected Behavior

works fine

Actual Behavior

get fail:

  • Unable to parse client secret file to config: oauth2/google: no credentials found

Steps to Reproduce the Problem

$ go run quickstart.go

Specifications

it works after:
use google.DefaultClient instead google.ConfigFromJSON
'''
client, err := google.DefaultClient(oauth2.NoContext,
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/spreadsheets.readonly")
if err != nil {
log.Fatal(err)
}
'''
and need: export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my-token.json before go run

  • Go version (go version)
    go version go1.10.8 linux/amd64

  • OS (Mac/Linux/Windows)
    Linux

sheets.New() is depricated

Hey googlers!

Your sample code seems to be out of date. I am trying to run the code but this line gives me a problem. It seems like sheets.New() function was deprecated. Please, update the sample with correct function

Specifications

  • Go version (go version) --> go1.14.4 darwin/amd64
  • OS (Mac)

Add Calendar Snippets

Currently the documentation doesn't have code samples for calendar API for delete, get, patch, update the events in go.

  1. https://developers.google.com/calendar/api/v3/reference/events/delete?hl=en
  2. https://developers.google.com/calendar/api/v3/reference/events/get?hl=en
  3. https://developers.google.com/calendar/api/v3/reference/events/patch?hl=en
  4. https://developers.google.com/calendar/api/v3/reference/events/update?hl=en

I would like to contribute for the following sections and improve the documentation.
Thank you.

Logger Error and how to fix it

Expected Behavior

From the "View" menu, choose "Logs"
Should come out the log likes this:
[19-10-14 10:05:16:913 HKT] Hello, world!

Actual Behavior

From the "View" menu, choose "Logs"
Come out the log likes this:
No logs found. Use Logger API to add logs to your project.

Steps to Reproduce the Problem

1.From the "View" menu, choose "Logs"

Steps to fix it

In 100 line of quickstart.go is as below:
Source: "function helloWorld() {\n console.log('Hello, world!');}",
change to:
Source: "function helloWorld() {\n Logger.log('Hello, world!');}",

Specifications

  • Go version (go version)
  • OS (Mac/Linux/Windows)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.