31
internal/wire/testdata/Varargs/foo/foo.go
vendored
Normal file
31
internal/wire/testdata/Varargs/foo/foo.go
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2018 The Wire Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(injectedMessage("", "Hello,", "World!"))
|
||||
}
|
||||
|
||||
type title string
|
||||
|
||||
// provideMessage provides a friendly user greeting.
|
||||
func provideMessage(words ...string) string {
|
||||
return strings.Join(words, " ")
|
||||
}
|
||||
26
internal/wire/testdata/Varargs/foo/wire.go
vendored
Normal file
26
internal/wire/testdata/Varargs/foo/wire.go
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2018 The Wire Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//+build wireinject
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/google/wire"
|
||||
)
|
||||
|
||||
func injectedMessage(t title, lines ...string) string {
|
||||
wire.Build(provideMessage)
|
||||
return ""
|
||||
}
|
||||
1
internal/wire/testdata/Varargs/pkg
vendored
Normal file
1
internal/wire/testdata/Varargs/pkg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
example.com/foo
|
||||
1
internal/wire/testdata/Varargs/want/program_out.txt
vendored
Normal file
1
internal/wire/testdata/Varargs/want/program_out.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello, World!
|
||||
13
internal/wire/testdata/Varargs/want/wire_gen.go
vendored
Normal file
13
internal/wire/testdata/Varargs/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(t title, lines ...string) string {
|
||||
string2 := provideMessage(lines...)
|
||||
return string2
|
||||
}
|
||||
Reference in New Issue
Block a user