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
Closed
Milestone

Comments

@millergarym
Copy link

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
Copy link
Contributor

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

@bcmills
Copy link
Contributor

bcmills 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 as completed Jun 21, 2018
@millergarym
Copy link
Author

@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
Copy link
Contributor

@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
Copy link
Member

myitcv 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
Development

No branches or pull requests

5 participants