Skip to content

Commit

Permalink
Fix doc for fx.As (#806)
Browse files Browse the repository at this point in the history
There are couple of invalid expressions in the code sample given in the docs for fx.As.

This fixes that.
  • Loading branch information
sywhang authored Nov 9, 2021
1 parent 69db4e1 commit 5bb9132
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions annotated.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var _ asAnnotation = asAnnotation{}
// bytes.NewBuffer (bytes.Buffer) should be provided as io.Writer type:
//
// fx.Provide(
// fx.Annotate(bytes.NewBuffer(...), fx.As(io.Writer))
// fx.Annotate(bytes.NewBuffer(...), fx.As(new(io.Writer)))
// )
//
// In other words, the code above is equivalent to:
Expand All @@ -229,7 +229,7 @@ var _ asAnnotation = asAnnotation{}
// ...
// }
// fx.Provide(
// fx.Annotate(a, fx.As(io.Writer, io.Reader))
// fx.Annotate(a, fx.As(new(io.Writer), new(io.Reader)))
// )
//
// Is equivalent to,
Expand Down

0 comments on commit 5bb9132

Please sign in to comment.