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: vgo build ignores import comment #24188

cybrcodr opened this issue Mar 1, 2018 · 2 comments

x/vgo: vgo build ignores import comment #24188

cybrcodr opened this issue Mar 1, 2018 · 2 comments


Copy link

@cybrcodr cybrcodr commented Mar 1, 2018

Please answer these questions before submitting your issue. Thanks!

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

$ go version
go version go1.10 darwin/amd64

What did you do?

I followed the vgo tour at
I forked repo to my own at
I have a go-import redirect at that produces ...

<meta name="go-import" content=" git">

I rewrote hello.go ...

package main

import (


func main() {

with go.mod ...

module "hello"

require (
   "" v1.5.2

Note that quote.go still has

package quote // import ""


vgo build builds fine. Note that vgo get also fetches the package without any failures. I then attempted to use normal go get which showed an error because I forgot to update the import comment.

What did you expect to see?

Unless it is expected for vgo to ignore import comments, it should probably error out like normal go does.

@gopherbot gopherbot added this to the vgo milestone Mar 1, 2018

This comment has been minimized.

Copy link

@rsc rsc commented Mar 27, 2018

It does ignore import comments, and intentionally. As long as go.mod is up-to-date, I think import comments become redundant / deprecated. But maybe that will change. Will leave this open until we're sure.

@rsc rsc added the NeedsDecision label Mar 27, 2018

This comment has been minimized.

Copy link

@rsc rsc commented Jun 6, 2018

I think I'm OK with vgo not checking these comments. The go.mod lines will become the source of truth.

@rsc rsc closed this Jun 6, 2018
bzzoop added a commit to cactus/go-camo that referenced this issue Aug 2, 2018
it seems[1] like the import comments are no longer required for vgo.
so... remove them.

[1]: golang/go#24188
@golang golang locked and limited conversation to collaborators Jun 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.