goose: strip vendor from generated import paths

This allows goose to work more gracefully in a vgo setting.

Reviewed-by: Tuo Shan <shantuo@google.com>
This commit is contained in:
Ross Light
2018-04-04 10:58:07 -07:00
parent 9af97a68c4
commit c594f05699
8 changed files with 85 additions and 9 deletions

View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println(injectedMessage())
}

View File

@@ -0,0 +1,11 @@
//+build gooseinject
package main
import (
_ "bar"
)
//goose:use "bar".Message
func injectedMessage() string

View File

@@ -0,0 +1,9 @@
// Package bar is the vendored copy of bar which contains the real provider.
package bar
//goose:provide Message
// ProvideMessage provides a friendly user greeting.
func ProvideMessage() string {
return "Hello, World!"
}