Skip to content

DeferStmt doesnt behave as expected.  #6

@nicolasdilley

Description

@nicolasdilley

At the moment they are always printed at the end of the blockstmt. However, in the case of a return, they are bypassed

go func() {
defer func() { <-limitCh }()
defer wg.Done()

		path, version, agent, ok, err := isGo(pr)
		if err != nil {
			// TODO(jbd): Return a list of errors.
		}
		if !ok {
			return
		}
		found <-0
	}()

for example in this case, the return will bypass the deferstmts.
One solution is to add the deferstmts at the end of the body of the proctype being generated.

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