Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: normalize path separators in Go crawler PURLs on Windows
On Windows, `Path::strip_prefix` + `to_string_lossy()` produces
backslashes in the relative path, which get embedded in the PURL
(e.g., `pkg:golang/github.com\\gin-gonic\\gin@v1.9.1`). Replace
backslashes with forward slashes to produce correct PURLs on all
platforms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
mikolalysenko and claude committed Mar 5, 2026
commit 651344c2d4a1d040585d00cb9066dcc801f2d582
5 changes: 3 additions & 2 deletions crates/socket-patch-core/src/crawlers/go_crawler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ impl GoCrawler {
_dir_name: &str,
seen: &mut HashSet<String>,
) -> Option<CrawledPackage> {
// Get the relative path from the cache root
// Get the relative path from the cache root.
// Normalize to forward slashes so PURLs are correct on Windows.
let rel_path = dir_path.strip_prefix(base_path).ok()?;
let rel_str = rel_path.to_string_lossy();
let rel_str = rel_path.to_string_lossy().replace('\\', "/");

// Find the last `@` to split module path and version
let at_idx = rel_str.rfind('@')?;
Expand Down