Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vgo: "no Go source files" when importing package google.golang.org/api #25994

Closed
millergarym opened this issue Jun 21, 2018 · 5 comments

Comments

@millergarym
Copy link

commented Jun 21, 2018

What version of Go are you using (go version)?

go 1.10.3
vgo commit c07973ea63c163b154225425f63290d022df8650

What operating system and processor architecture are you using (go env)?

windows

What did you do?

package example // import "x.y/z/a"

import (
  _ "google.golang.org/api"
)
module x.y/z/a

What did you see instead?

vgo build returned "no Go source files"

vgo list

vgo list -f "{{.}}" google.golang.org/api also return a message along the line of no Go source.

@gopherbot gopherbot added this to the vgo milestone Jun 21, 2018

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2018

google.golang.org/api is not a package, you need to import one of the actual packages inside the folder

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 21, 2018

Closing per @AlexRouSg's comment. (If you're having trouble importing specific subpackages, please reopen with more detail.)

@bcmills bcmills closed this Jun 21, 2018

@millergarym

This comment has been minimized.

Copy link
Author

commented Jun 23, 2018

@AlexRouSg @bcmills what if the repo has not Go source (eg a repo if protobufs).
Why should this be out of scope of vgo? (imo it shouldn't)

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2018

@millergarym This issue is not about vgo supporting getting repo's with non go files. This is about importing a non go package and having a non go package in the mod file. That is not something vgo would allow you to do.

Currently when vgo gets a package it gets the entire repo. So you shouldn't need to specifically tell it to get the non go files folders.

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 25, 2018

This is about importing a non go package and having a non go package in the mod file.

@millergarym at present there is no concept of a "non go package": packages are defined by being just that, collections of Go (and related) code. See go help list for the full breakdown of what the go tool understands as the contents of a package.

So whilst this might be a potential future extension of vgo/go, I don't personally see this as being something that will be supported in the short term.

The workaround as described is to drop a single .go file along with a go.mod file as a container for the non Go files you want to package, or to side-step vgo altogether and manage the dependency yourself/using some other tool.

@golang golang locked and limited conversation to collaborators Jun 25, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.