Skip to content

x/tools/cmd/goimports: interspersed comments can be associated with the wrong import #28200

@benesch

Description

@benesch

Given the following file:

# foo.go

package main

import (
	_ "bar"
	// foo has side effects.
	_ "foo"
)

goimports will incorrectly associate the comment with "bar" instead of "foo", producing this file:

package main

import (
	_ "bar" // foo has side effects.
	_ "foo"
)

This is using the latest master of the tools repo (5e66757).

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis 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