A Go tool that automatically fills in zero-value return statements to match function signatures, saving development time.
goreturns is a command-line tool for Go developers that automatically completes return statements with appropriate zero values based on function return types. It saves time by eliminating the need to manually add nil, 0, or other zero-value returns when writing Go functions, preventing compilation errors from incomplete returns.
Go developers who want to reduce boilerplate code and prevent return statement errors, particularly those already using gofmt or goimports in their workflow.
Developers choose goreturns because it seamlessly integrates with existing Go tooling as a drop-in replacement for gofmt/goimports while adding intelligent return statement completion, saving time and reducing errors in daily development.
A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Analyzes function signatures and inserts appropriate zero values like nil or 0, as demonstrated in the README example where it fixes an incomplete return statement with errors.New('foo').
Acts as a drop-in replacement for gofmt and goimports with identical command-line flags, making it easy to adopt without disrupting existing workflows, as stated in the README.
Runs goimports first to handle imports before processing returns, ensuring comprehensive code cleanup in a single step, which is highlighted in the README's integration details.
Can be integrated into editor save hooks for real-time correction, allowing developers to automatically fix returns during development, as mentioned in the README's editor integration section.
Only focuses on completing return statements with zero values, missing other common boilerplate tasks like error handling or struct initialization, which might require additional tools.
May automatically insert zero values in cases where developers have intentionally omitted returns for refactoring or testing, leading to unintended code changes without warning.
The README provides no options to customize zero values or disable goimports integration, limiting flexibility for teams with specific coding standards or preferences.