Skip to content

Commit

Permalink
fx.Extract: Deprecate in favor of populate (uber-go#889)
Browse files Browse the repository at this point in the history
fx.Extract is an older, poorer version of fx.Populate.
fx.Populate works on any value type, and fx.Extract requires building a
placeholder struct.

We meant to deprecate it right away, but because of widespread use of
staticcheck at the time, we marked it as "will be deprecated".

This finally deprecates it.
  • Loading branch information
abhinav authored Jun 4, 2022
1 parent 9b280ee commit e4e7928
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ var _typeOfIn = reflect.TypeOf(In{})
// container on application initialization. The target MUST be a pointer to a
// struct. Only exported fields will be filled.
//
// Extract will be deprecated soon: use Populate instead, which doesn't
// require defining a container struct.
// Deprecated: Use Populate instead.
func Extract(target interface{}) Option {
v := reflect.ValueOf(target)

Expand Down

0 comments on commit e4e7928

Please sign in to comment.