Skip to content

x/vgo: vgo build ignores import comment #24188

@cybrcodr

Description

@cybrcodr

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 https://research.swtch.com/vgo-cmd.
I forked rsc.io/quote repo to my own at https://github.com/cybrcodr/quote.
I have a go-import redirect at https://go.cybrcodr.net/quote that produces ...

<meta name="go-import" content="go.cybrcodr.net/quote git https://github.com/cybrcodr/quote">

I rewrote hello.go ...

package main

import (
   "fmt"

   "go.cybrcodr.net/quote"
)

func main() {
   fmt.Println(quote.Hello())
}

with go.mod ...

module "hello"

require (
   "go.cybrcodr.net/quote" v1.5.2
)

Note that quote.go still has

package quote // import "rsc.io/quote"

See https://github.com/cybrcodr/quote/blob/v1.5.2/quote.go#L6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions