x/tools/go/ast/astutil: DeleteImport leaves behind inline comments #43291
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
i try use astutil.DeleteImport to delete a import spec, just like:
i want to delete import "git.xxx.xxx/xx/common" with comment, but i got it:
What did you expect to see?
What did you see instead?
i check
golang.org/x/tools/go/ast/astutil/import_test.go
, it's same my test.So,i has a question:
why did delete a import spec which not contain comment?
this Comment Field belong to ast.ImportSpec in source ccode:
i think delete a import spec which should delete a full ImportSpec (about comment)
why was it designed this way?
Looking forward to your reply, Thanks.
The text was updated successfully, but these errors were encountered: