Comments (27)
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.
Thanks for the issue. Which quickstart were you running?
from go-samples.
from go-samples.
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.
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.
from go-samples.
same shit :)
from go-samples.
of course glide get cloud.google.com/go/compute/metadata
(or go get ...
) fixed this
from go-samples.
Do you think we should add go get -u cloud.google.com/go/compute/metadata
to our samples?
from go-samples.
I guess so — it would be nice if "quickstart" means real quick start without a hassle
from go-samples.
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.
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.
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.
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.
Yeah that command would definitely feel more intuitive in the context of this repo
from go-samples.
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.
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.
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.
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.
@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.
@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.
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.
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.
@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.
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.
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.
The trailing /...
solved the issue for me also.
from go-samples.
Related Issues (20)
- Golang Gmail Api HOT 4
- Logger Error and how to fix it
- Credentials problem HOT 2
- Error 500: Requested Resource Too Large to Return, responseTooLarge
- token expired and refresh token is not set HOT 1
- Unable to parse client secret file to config: oauth2/google: missing redirect URL in the client_credentials.json exit status 1 HOT 2
- Specify sheet in spreadsheets HOT 1
- Getting Unauthorized HOT 1
- sheets.New() is depricated HOT 1
- don't get token
- Unable to view or download the file uploaded using File.get(File id)
- Feature Request: Manage Group members snippets HOT 1
- "No required module provides package" errors
- Dependency Dashboard
- gmail quickstart.go will not retrieve a token HOT 9
- [SyncRepoSettings bot] - Invalid config file
- Add Calendar Snippets
- Quickstart needs OOB update HOT 1
- Googlesheets Quickstart example unreachable in localhost HOT 3
- Error Malformed auth code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-samples.