Skip to content

Commit

Permalink
gofmt updates
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtreece committed Feb 7, 2024
1 parent 53d7f7c commit 3b84e86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
6 changes: 3 additions & 3 deletions internal/wire/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1173,9 +1173,9 @@ func (pt ProvidedType) IsNil() bool {
//
// - For a function provider, this is the first return value type.
// - For a struct provider, this is either the struct type or the pointer type
// whose element type is the struct type.
// - For a value, this is the type of the expression.
// - For an argument, this is the type of the argument.
// whose element type is the struct type.
// - For a value, this is the type of the expression.
// - For an argument, this is the type of the argument.
func (pt ProvidedType) Type() types.Type {
return pt.t
}
Expand Down
1 change: 0 additions & 1 deletion internal/wire/wire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ type testCase struct {
// program_out.txt
// expected output from the final compiled program,
// missing if wire_errs.txt is present
//
func loadTestCase(root string, wireGoSrc []byte) (*testCase, error) {
name := filepath.Base(root)
pkg, err := ioutil.ReadFile(filepath.Join(root, "pkg"))
Expand Down
36 changes: 18 additions & 18 deletions wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ type StructProvider struct{}
//
// For example:
//
// type S struct {
// MyFoo *Foo
// MyBar *Bar
// }
// var Set = wire.NewSet(wire.Struct(new(S), "MyFoo")) -> inject only S.MyFoo
// var Set = wire.NewSet(wire.Struct(new(S), "*")) -> inject all fields
// type S struct {
// MyFoo *Foo
// MyBar *Bar
// }
// var Set = wire.NewSet(wire.Struct(new(S), "MyFoo")) -> inject only S.MyFoo
// var Set = wire.NewSet(wire.Struct(new(S), "*")) -> inject all fields
func Struct(structType interface{}, fieldNames ...string) StructProvider {
return StructProvider{}
}
Expand All @@ -175,22 +175,22 @@ type StructFields struct{}
//
// The following example would provide Foo and Bar using S.MyFoo and S.MyBar respectively:
//
// type S struct {
// MyFoo Foo
// MyBar Bar
// }
// type S struct {
// MyFoo Foo
// MyBar Bar
// }
//
// func NewStruct() S { /* ... */ }
// var Set = wire.NewSet(wire.FieldsOf(new(S), "MyFoo", "MyBar"))
// func NewStruct() S { /* ... */ }
// var Set = wire.NewSet(wire.FieldsOf(new(S), "MyFoo", "MyBar"))
//
// or
// or
//
// func NewStruct() *S { /* ... */ }
// var Set = wire.NewSet(wire.FieldsOf(new(*S), "MyFoo", "MyBar"))
// func NewStruct() *S { /* ... */ }
// var Set = wire.NewSet(wire.FieldsOf(new(*S), "MyFoo", "MyBar"))
//
// If the structType argument is a pointer to a pointer to a struct, then FieldsOf
// additionally provides a pointer to each field type (e.g., *Foo and *Bar in the
// example above).
// If the structType argument is a pointer to a pointer to a struct, then FieldsOf
// additionally provides a pointer to each field type (e.g., *Foo and *Bar in the
// example above).
func FieldsOf(structType interface{}, fieldNames ...string) StructFields {
return StructFields{}
}

0 comments on commit 3b84e86

Please sign in to comment.