google / wire

Compile-time Dependency Injection for Go
Apache License 2.0
13.13k stars 623 forks source link

Cleanup functions should return erors #409

Open nejtr0n opened 4 months ago

nejtr0n commented 4 months ago

Is your feature request related to a problem? Please describe.

Cleanup function has bad signature without returning error now. Basic usage of this functions to close connection or other resources. So it should be better to return error imho.

Describe the solution you'd like

Change cleanup function signature from func() to func() error or io.Closer contract

Describe alternatives you've considered

Dunno how to handle cleanup errors now.