Sibling of the bug fixed in #85, found during its review. A kept line inside a Go import block with a trailing comment still feeds both quoted strings to the path regex:
import (
"fmt" // "github.com/spf13/cobra"
)
credits github.com/spf13/cobra even though it only exists inside the comment. #85 fixed whole-line comments inside blocks; this is the same class at a different position. The fix needs to strip the trailing-comment portion of kept block lines before the path regex runs (mind // inside quoted strings — Go import paths can't contain spaces, which helps).
Deliverable: the guard + positive/negative regression tests in test/import-detect.test.ts, same style as #85's. @eeshsaxena has first claim if wanted (their find, effectively); open to anyone otherwise.
Sibling of the bug fixed in #85, found during its review. A kept line inside a Go import block with a trailing comment still feeds both quoted strings to the path regex:
credits
github.com/spf13/cobraeven though it only exists inside the comment. #85 fixed whole-line comments inside blocks; this is the same class at a different position. The fix needs to strip the trailing-comment portion of kept block lines before the path regex runs (mind//inside quoted strings — Go import paths can't contain spaces, which helps).Deliverable: the guard + positive/negative regression tests in test/import-detect.test.ts, same style as #85's. @eeshsaxena has first claim if wanted (their find, effectively); open to anyone otherwise.