Giter VIP home page Giter VIP logo

Comments (27)

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024 3

I'm not a go expert, but from what I can tell running the command:

go get -u golang.org/x/oauth2/...

Installs the library and the compute/metadata dependency. That's the answer on golang/oauth2#88 and I've been able to confirm this on my own machine. Please verify that you are installing with the trailing /....

from go-samples.

grant avatar grant commented on July 1, 2024

Thanks for the issue. Which quickstart were you running?

from go-samples.

arnau-rius avatar arnau-rius commented on July 1, 2024

from go-samples.

grant avatar grant commented on July 1, 2024

I didn't need go/compute/metadata when running this. Is this a problem when running on a PC/laptop or just an issue when running on a server?

from go-samples.

grant avatar grant commented on July 1, 2024

Hi @arnaurius,

I just tried this sample without installing compute/metadata from the command line, perhaps it is required in your environment? Are you running from a server? Google Compute Engine? Maybe we can add a note for if you are in this environment.

These are the instructions I followed:

go get -u google.golang.org/api/sheets/v4
go get -u golang.org/x/oauth2/...
go run quickstart.go
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=59206675741-mt72vm4635ft7ct5ddhudaoikaa6nn3d.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/QQCTaCWGiYULWQOdHDpAZs35Xt-1qiwi5H2dtdaACq14m1CKDgNnfaU
Saving credential file to: token.json
Name, Major:
Alexandra, English
Andrew, Math
Anna, English
Becky, Art
Benjamin, English
Carl, Art
Carrie, English
Dorothy, Math
Dylan, Math
Edward, English
Ellen, Physics
Fiona, Art
John, Physics
Jonathan, Math
Joseph, English
Josephine, Math
Karen, English
Kevin, Physics
Lisa, Art
Mary, Physics
Maureen, Physics
Nick, Art
Olivia, Physics
Pamela, Math
Patrick, Art
Robert, English
Sean, Physics
Stacy, Math
Thomas, Art
Will, Math

Can you state your:

  • go version
  • Operating system

Thanks, Grant

from go-samples.

arnau-rius avatar arnau-rius commented on July 1, 2024

from go-samples.

rusjoan avatar rusjoan commented on July 1, 2024

same shit :)

from go-samples.

rusjoan avatar rusjoan commented on July 1, 2024

of course glide get cloud.google.com/go/compute/metadata (or go get ...) fixed this

from go-samples.

grant avatar grant commented on July 1, 2024

Do you think we should add go get -u cloud.google.com/go/compute/metadata to our samples?

from go-samples.

grglcs avatar grglcs commented on July 1, 2024

I guess so — it would be nice if "quickstart" means real quick start without a hassle

from go-samples.

grant avatar grant commented on July 1, 2024

Can someone create a PR that adds that the metadata go get command to each README?

It seems like this fixes everyone's problems.

from go-samples.

henry-jackson avatar henry-jackson commented on July 1, 2024

This is a an awesome resource for gsuite! I ran into the same issue and decided to fix the dependency lists. Check PR #25

from go-samples.

henry-jackson avatar henry-jackson commented on July 1, 2024

Hey Eric, just checked my bash_history and you're right. I forgot the trailing ellipses which is why I had to get compute/metadata separately. Sorry for the confusion!

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

From what I can tell using

go get -u golang.org/x/oauth2/google

Also fetches the dependencies. Is that format clearer?

from go-samples.

henry-jackson avatar henry-jackson commented on July 1, 2024

Yeah that command would definitely feel more intuitive in the context of this repo

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

Would you be willing to update your PR to switch the READMEs to use that command? I'll do the same in the Quickstart pages in the docs.

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

I've updated the instructions in the documentation to use the new version: https://developers.google.com/sheets/api/quickstart/go#step_2_prepare_the_workspace

from go-samples.

ef2k avatar ef2k commented on July 1, 2024

I started running into this issue last night. At the moment this is the result I'm getting:

go get -u golang.org/x/oauth2/...
go: finding golang.org/x/oauth2 latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/net latest
go: finding cloud.google.com/go/compute/metadata latest
go: finding cloud.google.com/go/compute latest
go build cloud.google.com/go/compute/metadata: no Go files in

The same applies to go get -u golang.org/x/oauth2/google.

from go-samples.

henry-jackson avatar henry-jackson commented on July 1, 2024

Would you be willing to update your PR to switch the READMEs to use that command? I'll do the same in the Quickstart pages in the docs.

Just updated the PR to reflect these changes

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

@ef2k Thanks for the additional detail. Can you provide more information about your environment? What version of Go, what OS, etc. It looks like the last line of your error is cut off:

No Go files in

Is there more after that?

from go-samples.

ef2k avatar ef2k commented on July 1, 2024

@erickoledadevrel, you're welcome. Yes, unfortunately, the error cuts off at that point.
I'm on go version go1.11.4 darwin/amd64. OS: macos 10.14.2 (mojave)

Edit:
FWIW, go get -u cloud.google.com/go/..., as instructured here: https://github.com/googleapis/google-cloud-go. Also results in similar error messages:

go: finding cloud.google.com/go/internal latest
go: finding cloud.google.com/go/compute/metadata latest
go: finding cloud.google.com/go/longrunning latest
go: finding cloud.google.com/go/longrunning/autogen latest
go: finding cloud.google.com/go/internal/version latest
go: finding cloud.google.com/go/compute latest
go build cloud.google.com/go/longrunning/autogen: no Go files in
go build cloud.google.com/go/longrunning: no Go files in
go build cloud.google.com/go/compute/metadata: no Go files in
go build cloud.google.com/go/internal: no Go files in
go build cloud.google.com/go/internal/version: no Go files in

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

I just updated to go 1.11.4 on my Mac (running OSX 10.13.6) and it installed fine. Can you include the -v flag in your go get command, to see if the verbose output has any additional detail?

from go-samples.

ef2k avatar ef2k commented on July 1, 2024

Thanks for the help. Here's the tail of the log right before it fails. Note: The message is cutoff in the end.

$ go get -v -u golang.org/x/oauth2/google
...
Fetching https://cloud.google.com/go?go-get=1
Parsing meta tags from https://cloud.google.com/go?go-get=1 (status code 200)
go: finding cloud.google.com/go/compute/metadata latest
Fetching https://cloud.google.com/go/compute?go-get=1
Parsing meta tags from https://cloud.google.com/go/compute?go-get=1 (status code 200)
get "cloud.google.com/go/compute": found meta tag get.metaImport{Prefix:"cloud.google.com/go", VCS:"git", RepoRoot:"https://code.googlesource.com/gocloud"} at https://cloud.google.com/go/compute?go-get=1
get "cloud.google.com/go/compute": verifying non-authoritative meta tag
go: finding cloud.google.com/go/compute latest
Fetching https://cloud.google.com?go-get=1
Parsing meta tags from https://cloud.google.com?go-get=1 (status code 200)
cloud.google.com/go/compute/metadata
go build cloud.google.com/go/compute/metadata: no Go files in

from go-samples.

ef2k avatar ef2k commented on July 1, 2024

@erickoledadevrel thanks again for the help. I wiped out $GOPATH/pkg and ran the go get commands again and it fetched successfully this time. All good now. Thanks for your time.

from go-samples.

erickoledadevrel avatar erickoledadevrel commented on July 1, 2024

Turn it off and turn it on again fixes a surprisingly large number of problems 😃 Glad you got it working, closing this issue.

from go-samples.

Macifier avatar Macifier commented on July 1, 2024

I'm not a go expert, but from what I can tell running the command:

go get -u golang.org/x/oauth2/...

Installs the library and the compute/metadata dependency. That's the answer on golang/oauth2#88 and I've been able to confirm this on my own machine. Please verify that you are installing with the trailing /....

You just saved my life...

from go-samples.

jcconnell avatar jcconnell commented on July 1, 2024

The trailing /... solved the issue for me also.

from go-samples.

Related Issues (20)

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.