Two Cross-Platform Bugs in Our Go CLI (And How We Fixed Them)
The article discusses two cross-platform bugs encountered while developing the Go CLI for TestSmith. Both issues were related to path handling and filesystem traversal, specifically on Windows. The solutions involved refining the logic for detecting project roots and correcting hardcoded path separators.
- ▪The first bug involved incorrect detection of project types due to assumptions about .git directories.
- ▪The second bug was related to hardcoded path separators that caused discrepancies in file paths on Windows.
- ▪Both bugs were not visible on macOS and Linux, highlighting the importance of cross-platform testing.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 409515) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Oscar Rieken Posted on May 27 Two Cross-Platform Bugs in Our Go CLI (And How We Fixed Them) #go #debugging #windows #testing Building TestSmith (6 Part Series) 1 Why We Built TestSmith: The Test Coverage Problem Nobody Talks About 2 Why We Rewrote Our Python CLI in Go (and What We Gained) ... 2 more parts...
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).