Skip to content

Incorrect rewrite of bare return at end of block when comment follows #57

Open
@philoserf

Description

@philoserf

Here is a diff example of bare return rewrite when using goreturns -b -i -l -w .:

 	if err != nil {
-		return
+		return output,
+
+			// Processing output
+			err
 	}

-	// Processing output
 	if updateCache {

expected result:

 	if err != nil {
-		return
+		return output, err
 	}

	// Processing output
 	if updateCache {

It is interesting that the rewrite escapes the {...} block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions