Skip to content

feat: read the go line from go.work with --work - #8

Open
ducnhan123-co wants to merge 1 commit into
GillMacedo:mainfrom
ducnhan123-co:feat/4-work-mode
Open

ducnhan123-co wants to merge 1 commit into
GillMacedo:mainfrom
ducnhan123-co:feat/4-work-mode

Conversation

@ducnhan123-co

Copy link
Copy Markdown

Issue

Closes #4

What changed

Add --work for workspace mode. It reads the go line from go.work, copies go.work/go.work.sum to a temporary file, rewrites relative use and local replace paths to absolute paths, and lists each workspace module with go list and GOWORK pointing at the copy.

The report says in workspace and, because go.work has no godebug lines, prints //go:debug directives (or GODEBUG) instead of a go.mod block. Module godebug lines are noted as ignored in workspace mode.

Added examples/workspace (two modules), unit tests for reading/copying go.work and resolving a workspace, and an integration test that checks both binaries and that go.work is unchanged.

Why

In workspace mode the go line in go.work sets GODEBUG defaults. The tool previously only noted an active go.work and ignored it, so it could not answer the question for multi-module repositories.

Checklist

  • make test passes
  • The title says what changed for users, because it becomes the changelog line
  • ROADMAP.md and docs updated if relevant
  • If an AI agent helped, I've said so and reviewed the result

Implemented with help from an AI coding agent; I reviewed and tested the result.

Add a --work mode that reads the go line from go.work, copies
go.work and go.work.sum, rewrites relative use and local replace
paths, and lists every workspace module.

The report uses //go:debug directives instead of a go.mod godebug
block, because go.work has no godebug lines.

Closes GillMacedo#4.

@GillMacedo GillMacedo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated check, before a person reads this PR. Please fix the following and push again:

  • It changes files that can't be merged through this automated process: .claude-plugin/marketplace.json, plugin/.claude-plugin/plugin.json. Please remove those changes and push again.

Thanks for contributing. The rules are in CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read the go line from go.work in workspace mode

2 participants