Skip to content

When positions doesn't matter #3

@lindell

Description

@lindell

I've come across a problem where I want to copy everything except the position.
To solve this problem I cloned astcopy.go and made changes to all functions.

For example, this is how the UnaryExpr is now copied:

func UnaryExpr(x *ast.UnaryExpr) *ast.UnaryExpr {
	if x == nil {
		return nil
	}
	return &ast.UnaryExpr{
		Op: x.Op,
		X:  copyExpr(x.X),
	}
}

Is this something you would like to incorporate into this repo. Otherwise I will clone this repo and make an alternative version of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions