Skip to content

x/tools/imports: consider exporting fixImports #23782

Closed
@eikenb

Description

@eikenb

This is a 3 character change that would make this module much more useful for people working on custom formatting solutions. Without this you need to format the code and then re-parse it to get the ast with the fixed imports which is very inefficient.

What version of Go are you using (go version)?

1.9/tip

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

N/A

What did you do?

Wanted to fix the imports at the ast.File level using the x/tools/imports lib.

What did you expect to see?

fixImports should be FixImports so it is public and can be used when working with ast's vs. files.

What did you see instead?

It is not public and I am forced to fork the project to use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions