• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-mate / go-work / 20190686592 / 4
66%
main: 66%

Build:
DEFAULT BRANCH: main
Ran 13 Dec 2025 10:22AM UTC
Files 5
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Dec 2025 10:19AM UTC coverage: 65.865% (-0.03%) from 65.899%
20190686592.4

push

github

yangyile
Streamline workspath API with functional options pattern

BREAKING CHANGES - Migration Guide:
- Old: NewOptions().WithIncludeCurrentProject(true).WithIncludeSubModules(true)
- New: GetModulePaths(path, WithCurrentProject(), ScanDeep(), SkipNoGo())
- Old: FindModulePaths(path, options)
- New: GetModulePaths(path, ...Option)
- Old: GetProjectPath() returns (root, subpath, ok)
- New: GetProjectPath() returns (*ProjectPath, ok) with Root/SubPath fields
- New: GetProjectRoot() returns (root, ok) - simple root detection

Code Changes:
- Split workspath into works_path.go and options.go
- Add functional options: WithCurrentProject(), WithCurrentPackage(), ScanDeep(), SkipNoGo(), DebugMode(), WithDebug(bool)
- Add GetProjectRoot() function - returns project root path
- Add ProjectPath struct with Root and SubPath fields
- Rename internal functions: shouldSkip→isHidden, hasGoFiles→existsGoFiles
- Reduce package from ~270 lines to ~160 lines

CLI Changes:
- Remove command execution (worksexec/worksubcmd packages removed in previous commit)
- Default command: list module paths with JSON output
- Add version subcommand: list Go versions from go.mod files
- Add cobra.NoArgs to restrict arguments
- Use golang.org/x/mod/modfile to parse go.mod

Documentation and CI:
- Update README.md and README.zh.md with new API examples
- Update footer template to version 2025-11-25
- Add .github/workflows/release.yml with Go 1.22.x-1.25.x matrix
- Update Go version badge link to go.dev

Tests:
- Add tests: GetProjectPath, GetProjectRoot, GetModulePaths with options
- Add edge case tests: NotFound, RootIsModule, ScanDeep, SkipNoGo, NotModule
- Use setupTestProject/cleanupDIR test helpers

137 of 208 relevant lines covered (65.87%)

5.56 hits per line

Source Files on job Go-1.25.x - 20190686592.4
  • Tree
  • List 5
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 20190686592
  • 0b75b0f7 on github
  • Prev Job for on main (#18928945897.4)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc