wire: respect -record flag for tests (google/go-cloud#282)
Fixes google/go-cloud#281
This commit is contained in:
17
internal/wire/testdata/BuildTagsMainOnly/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/BuildTagsMainOnly/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := _wireStringValue
|
||||
return string2
|
||||
}
|
||||
|
||||
var (
|
||||
_wireStringValue = "Hello, World!"
|
||||
)
|
||||
17
internal/wire/testdata/BuildTagsRelativePkg/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/BuildTagsRelativePkg/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := _wireStringValue
|
||||
return string2
|
||||
}
|
||||
|
||||
var (
|
||||
_wireStringValue = "Hello, World!"
|
||||
)
|
||||
14
internal/wire/testdata/Chain/want/wire_gen.go
vendored
Normal file
14
internal/wire/testdata/Chain/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := provideFoo()
|
||||
fooBar := provideFooBar(foo)
|
||||
return fooBar
|
||||
}
|
||||
17
internal/wire/testdata/Cleanup/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/Cleanup/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectBar() (*Bar, func()) {
|
||||
foo, cleanup := provideFoo()
|
||||
bar, cleanup2 := provideBar(foo)
|
||||
return bar, func() {
|
||||
cleanup2()
|
||||
cleanup()
|
||||
}
|
||||
}
|
||||
27
internal/wire/testdata/CopyOtherDecls/want/wire_gen.go
vendored
Normal file
27
internal/wire/testdata/CopyOtherDecls/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
)
|
||||
|
||||
// Injectors from foo.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := provideMessage()
|
||||
return string2
|
||||
}
|
||||
|
||||
// foo.go:
|
||||
|
||||
func main() {
|
||||
fmt.Println(injectedMessage())
|
||||
}
|
||||
|
||||
func provideMessage() string {
|
||||
return "Hello, World!"
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
ERROR
|
||||
cycle
|
||||
@@ -1,2 +1 @@
|
||||
ERROR
|
||||
not a provider
|
||||
21
internal/wire/testdata/ExportedValue/want/wire_gen.go
vendored
Normal file
21
internal/wire/testdata/ExportedValue/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
bar "bar"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := _wireStringValue
|
||||
return string2
|
||||
}
|
||||
|
||||
var (
|
||||
_wireStringValue = bar.PublicMsg
|
||||
)
|
||||
21
internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go
vendored
Normal file
21
internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
os "os"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedFile() *os.File {
|
||||
file := _wireFileValue
|
||||
return file
|
||||
}
|
||||
|
||||
var (
|
||||
_wireFileValue = os.Stdout
|
||||
)
|
||||
17
internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
foo "foo"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooer() foo.Fooer {
|
||||
bar := provideBar()
|
||||
return bar
|
||||
}
|
||||
14
internal/wire/testdata/InjectInput/want/wire_gen.go
vendored
Normal file
14
internal/wire/testdata/InjectInput/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar(foo Foo) FooBar {
|
||||
bar := provideBar()
|
||||
fooBar := provideFooBar(foo, bar)
|
||||
return fooBar
|
||||
}
|
||||
@@ -1,3 +1,2 @@
|
||||
ERROR
|
||||
foo.Foo
|
||||
conflicts with provider
|
||||
13
internal/wire/testdata/InjectWithPanic/want/wire_gen.go
vendored
Normal file
13
internal/wire/testdata/InjectWithPanic/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := provideMessage()
|
||||
return string2
|
||||
}
|
||||
13
internal/wire/testdata/InterfaceBinding/want/wire_gen.go
vendored
Normal file
13
internal/wire/testdata/InterfaceBinding/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooer() Fooer {
|
||||
bar := provideBar()
|
||||
return bar
|
||||
}
|
||||
14
internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go
vendored
Normal file
14
internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
bar := provideBar()
|
||||
fooBar := provideFooBar(bar, bar)
|
||||
return fooBar
|
||||
}
|
||||
@@ -1,3 +1,2 @@
|
||||
ERROR
|
||||
no provider found for foo.Foo
|
||||
no provider found for foo.Bar
|
||||
20
internal/wire/testdata/NamingWorstCase/want/wire_gen.go
vendored
Normal file
20
internal/wire/testdata/NamingWorstCase/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
context2 "context"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func inject(context3 context2.Context, err2 struct{}) (context, error) {
|
||||
context4, err := provide(context3)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
}
|
||||
50
internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go
vendored
Normal file
50
internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
context2 "context"
|
||||
fmt "fmt"
|
||||
os "os"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// Injectors from foo.go:
|
||||
|
||||
func inject(context3 context2.Context, err2 struct{}) (context, error) {
|
||||
context4, err := Provide(context3)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
}
|
||||
|
||||
// foo.go:
|
||||
|
||||
type context struct{}
|
||||
|
||||
func main() {
|
||||
if _, ok := reflect.TypeOf(context{}).MethodByName("Provide"); !ok {
|
||||
fmt.Println("ERROR: context.Provide renamed")
|
||||
os.Exit(1)
|
||||
}
|
||||
c, err := inject(context2.Background(), struct{}{})
|
||||
if err != nil {
|
||||
fmt.Println("ERROR:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Println(c)
|
||||
}
|
||||
|
||||
func Provide(context2_2 context2.Context) (context, error) {
|
||||
var context3 = context2.Background()
|
||||
_ = context2_2
|
||||
_ = context3
|
||||
return context{}, nil
|
||||
}
|
||||
|
||||
func (context) Provide() {
|
||||
}
|
||||
13
internal/wire/testdata/NiladicIdentity/want/wire_gen.go
vendored
Normal file
13
internal/wire/testdata/NiladicIdentity/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := provideMessage()
|
||||
return string2
|
||||
}
|
||||
17
internal/wire/testdata/NiladicValue/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/NiladicValue/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := _wireStringValue
|
||||
return string2
|
||||
}
|
||||
|
||||
var (
|
||||
_wireStringValue = "Hello, World!"
|
||||
)
|
||||
@@ -1,3 +1,2 @@
|
||||
ERROR
|
||||
no provider found
|
||||
Fooer
|
||||
20
internal/wire/testdata/NoInjectParamNames/want/wire_gen.go
vendored
Normal file
20
internal/wire/testdata/NoInjectParamNames/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
context2 "context"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func inject(context3 context2.Context, arg struct{}) (context, error) {
|
||||
context4, err := provide(context3)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
}
|
||||
0
internal/wire/testdata/NoopBuild/want/wire_gen.go
vendored
Normal file
0
internal/wire/testdata/NoopBuild/want/wire_gen.go
vendored
Normal file
27
internal/wire/testdata/PartialCleanup/want/wire_gen.go
vendored
Normal file
27
internal/wire/testdata/PartialCleanup/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectBaz() (Baz, func(), error) {
|
||||
foo, cleanup := provideFoo()
|
||||
bar, cleanup2, err := provideBar(foo)
|
||||
if err != nil {
|
||||
cleanup()
|
||||
return 0, nil, err
|
||||
}
|
||||
baz, err := provideBaz(bar)
|
||||
if err != nil {
|
||||
cleanup2()
|
||||
cleanup()
|
||||
return 0, nil, err
|
||||
}
|
||||
return baz, func() {
|
||||
cleanup2()
|
||||
cleanup()
|
||||
}, nil
|
||||
}
|
||||
19
internal/wire/testdata/PkgImport/want/wire_gen.go
vendored
Normal file
19
internal/wire/testdata/PkgImport/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
bar "bar"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := provideFoo()
|
||||
bar2 := bar.ProvideBar()
|
||||
fooBar := provideFooBar(foo, bar2)
|
||||
return fooBar
|
||||
}
|
||||
16
internal/wire/testdata/ReturnError/want/wire_gen.go
vendored
Normal file
16
internal/wire/testdata/ReturnError/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFoo() (Foo, error) {
|
||||
foo, err := provideFoo()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return foo, nil
|
||||
}
|
||||
18
internal/wire/testdata/Struct/want/wire_gen.go
vendored
Normal file
18
internal/wire/testdata/Struct/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := provideFoo()
|
||||
bar := provideBar()
|
||||
fooBar := FooBar{
|
||||
Foo: foo,
|
||||
Bar: bar,
|
||||
}
|
||||
return fooBar
|
||||
}
|
||||
18
internal/wire/testdata/StructPointer/want/wire_gen.go
vendored
Normal file
18
internal/wire/testdata/StructPointer/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() *FooBar {
|
||||
foo := provideFoo()
|
||||
bar := provideBar()
|
||||
fooBar := &FooBar{
|
||||
Foo: foo,
|
||||
Bar: bar,
|
||||
}
|
||||
return fooBar
|
||||
}
|
||||
15
internal/wire/testdata/TwoDeps/want/wire_gen.go
vendored
Normal file
15
internal/wire/testdata/TwoDeps/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := provideFoo()
|
||||
bar := provideBar()
|
||||
fooBar := provideFooBar(foo, bar)
|
||||
return fooBar
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
ERROR
|
||||
unexported identifier privateMsg
|
||||
@@ -1,4 +1,3 @@
|
||||
ERROR
|
||||
unused provider set "unusedSet"
|
||||
unused provider "provideUnused"
|
||||
unused value of type string
|
||||
18
internal/wire/testdata/ValueChain/want/wire_gen.go
vendored
Normal file
18
internal/wire/testdata/ValueChain/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := _wireFooValue
|
||||
fooBar := provideFooBar(foo)
|
||||
return fooBar
|
||||
}
|
||||
|
||||
var (
|
||||
_wireFooValue = Foo(41)
|
||||
)
|
||||
17
internal/wire/testdata/ValueConversion/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/ValueConversion/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() Foo {
|
||||
foo := _wireFooValue
|
||||
return foo
|
||||
}
|
||||
|
||||
var (
|
||||
_wireFooValue = Foo("Hello, World!")
|
||||
)
|
||||
17
internal/wire/testdata/VarValue/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/VarValue/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := _wireStringValue
|
||||
return string2
|
||||
}
|
||||
|
||||
var (
|
||||
_wireStringValue = msg
|
||||
)
|
||||
17
internal/wire/testdata/Vendor/want/wire_gen.go
vendored
Normal file
17
internal/wire/testdata/Vendor/want/wire_gen.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate wire
|
||||
//+build !wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
bar "bar"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func injectedMessage() string {
|
||||
string2 := bar.ProvideMessage()
|
||||
return string2
|
||||
}
|
||||
Reference in New Issue
Block a user