all: move back to github.com/google/go-cloud (google/go-cloud#162)
Reverts changes made in google/go-cloud#120 for google/go-cloud#117
This commit is contained in:
@@ -11,10 +11,10 @@ initialization.
|
|||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
Install `gowire` by running the following inside the Go X Cloud repository:
|
Install `gowire` by running the following inside the Go Cloud repository:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
vgo install github.com/google/go-x-cloud/wire/cmd/gowire
|
vgo install github.com/google/go-cloud/wire/cmd/gowire
|
||||||
```
|
```
|
||||||
|
|
||||||
## Basics
|
## Basics
|
||||||
@@ -93,7 +93,7 @@ package foobarbaz
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// ...
|
// ...
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
@@ -138,7 +138,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
"example.com/foobarbaz"
|
"example.com/foobarbaz"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
// gowire is a compile-time dependency injection tool.
|
// gowire is a compile-time dependency injection tool.
|
||||||
//
|
//
|
||||||
// For an overview, see https://github.com/google/go-x-cloud/blob/master/wire/README.md
|
// For an overview, see https://github.com/google/go-cloud/blob/master/wire/README.md
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -31,7 +31,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire/internal/wire"
|
"github.com/google/go-cloud/wire/internal/wire"
|
||||||
"golang.org/x/tools/go/types/typeutil"
|
"golang.org/x/tools/go/types/typeutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ func isWireImport(path string) bool {
|
|||||||
if i := strings.LastIndex(path, vendorPart); i != -1 && (i == 0 || path[i-1] == '/') {
|
if i := strings.LastIndex(path, vendorPart); i != -1 && (i == 0 || path[i-1] == '/') {
|
||||||
path = path[i+len(vendorPart):]
|
path = path[i+len(vendorPart):]
|
||||||
}
|
}
|
||||||
return path == "github.com/google/go-x-cloud/wire"
|
return path == "github.com/google/go-cloud/wire"
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProviderOrValue is a pointer to a Provider or a Value. The zero value is
|
// ProviderOrValue is a pointer to a Provider or a Value. The zero value is
|
||||||
|
|||||||
2
internal/wire/testdata/Chain/foo/foo.go
vendored
2
internal/wire/testdata/Chain/foo/foo.go
vendored
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
internal/wire/testdata/Chain/foo/wire.go
vendored
2
internal/wire/testdata/Chain/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
2
internal/wire/testdata/Cleanup/foo/wire.go
vendored
2
internal/wire/testdata/Cleanup/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectBar() (*Bar, func()) {
|
func injectBar() (*Bar, func()) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
internal/wire/testdata/Cycle/foo/wire.go
vendored
2
internal/wire/testdata/Cycle/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedBaz() Baz {
|
func injectedBaz() Baz {
|
||||||
|
|||||||
2
internal/wire/testdata/EmptyVar/foo/wire.go
vendored
2
internal/wire/testdata/EmptyVar/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
package bar
|
package bar
|
||||||
|
|
||||||
import "github.com/google/go-x-cloud/wire"
|
import "github.com/google/go-cloud/wire"
|
||||||
|
|
||||||
var Value = wire.Value(PublicMsg)
|
var Value = wire.Value(PublicMsg)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bar"
|
"bar"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package bar
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Value = wire.Value(os.Stdout)
|
var Value = wire.Value(os.Stdout)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"bar"
|
"bar"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedFile() *os.File {
|
func injectedFile() *os.File {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"foo"
|
"foo"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
"foo"
|
"foo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar(foo Foo) FooBar {
|
func injectFooBar(foo Foo) FooBar {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectBar(foo Foo) Bar {
|
func injectBar(foo Foo) Bar {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooer() Fooer {
|
func injectFooer() Fooer {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
stdcontext "context"
|
stdcontext "context"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func inject(context stdcontext.Context, err struct{}) (context, error) {
|
func inject(context stdcontext.Context, err struct{}) (context, error) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
type context struct{}
|
type context struct{}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooer() Fooer {
|
func injectFooer() Fooer {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
stdcontext "context"
|
stdcontext "context"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The notable characteristic of this test is that there are no
|
// The notable characteristic of this test is that there are no
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectBaz() (Baz, func(), error) {
|
func injectBaz() (Baz, func(), error) {
|
||||||
|
|||||||
2
internal/wire/testdata/PkgImport/foo/foo.go
vendored
2
internal/wire/testdata/PkgImport/foo/foo.go
vendored
@@ -18,7 +18,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"bar"
|
"bar"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
internal/wire/testdata/PkgImport/foo/wire.go
vendored
2
internal/wire/testdata/PkgImport/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFoo() (Foo, error) {
|
func injectFoo() (Foo, error) {
|
||||||
|
|||||||
2
internal/wire/testdata/Struct/foo/foo.go
vendored
2
internal/wire/testdata/Struct/foo/foo.go
vendored
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
internal/wire/testdata/Struct/foo/wire.go
vendored
2
internal/wire/testdata/Struct/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() *FooBar {
|
func injectFooBar() *FooBar {
|
||||||
|
|||||||
2
internal/wire/testdata/TwoDeps/foo/foo.go
vendored
2
internal/wire/testdata/TwoDeps/foo/foo.go
vendored
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
internal/wire/testdata/TwoDeps/foo/wire.go
vendored
2
internal/wire/testdata/TwoDeps/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
package bar
|
package bar
|
||||||
|
|
||||||
import "github.com/google/go-x-cloud/wire"
|
import "github.com/google/go-cloud/wire"
|
||||||
|
|
||||||
var Value = wire.Value(privateMsg)
|
var Value = wire.Value(privateMsg)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bar"
|
"bar"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
2
internal/wire/testdata/ValueChain/foo/foo.go
vendored
2
internal/wire/testdata/ValueChain/foo/foo.go
vendored
@@ -17,7 +17,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectFooBar() FooBar {
|
func injectFooBar() FooBar {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() Foo {
|
func injectedMessage() Foo {
|
||||||
|
|||||||
2
internal/wire/testdata/VarValue/foo/wire.go
vendored
2
internal/wire/testdata/VarValue/foo/wire.go
vendored
@@ -17,7 +17,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
2
internal/wire/testdata/Vendor/foo/wire.go
vendored
2
internal/wire/testdata/Vendor/foo/wire.go
vendored
@@ -18,7 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bar"
|
"bar"
|
||||||
"github.com/google/go-x-cloud/wire"
|
"github.com/google/go-cloud/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func injectedMessage() string {
|
func injectedMessage() string {
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ func loadTestCase(root string, wireGoSrc []byte) (*testCase, error) {
|
|||||||
out = nil
|
out = nil
|
||||||
}
|
}
|
||||||
goFiles := map[string][]byte{
|
goFiles := map[string][]byte{
|
||||||
"github.com/google/go-x-cloud/wire/wire.go": wireGoSrc,
|
"github.com/google/go-cloud/wire/wire.go": wireGoSrc,
|
||||||
}
|
}
|
||||||
err = filepath.Walk(root, func(src string, info os.FileInfo, err error) error {
|
err = filepath.Walk(root, func(src string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user