sqs / goreturns

A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types
Other
530 stars 55 forks source link

Does not remove return values #26

Open ggeorgiev opened 8 years ago

ggeorgiev commented 8 years ago

When a return argument is removed it does not remove them from the return statements.

It seems equally tricky detecting where the ZERO value should be added as it is to be removed. Seems to me having these working in both directions will be very useful.

I personally would make it detecting if the current return statement fits the pattern: ZERO1, ..., ZEROn, error and in this case replace it - in both directions - and I would not touch any of the others, because it makes it error prone.