gomod

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package gomod keeps Go module paths in step with the project's identity.

Every module in the workspace is rooted at github.com/<repo_owner>/<name>: the shared module common/go owns that root directly, and each service owns the root plus its own name. When [project] name or repo_owner changes in project.toml, refresh calls Sync to propagate the new identity everywhere — rewriting the `module`, `require` and `replace` directives in every go.mod and the import paths that depend on them, so the project still builds after a rename.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sync

type Sync struct {
	// contains filtered or unexported fields
}

Sync reconciles Go module paths against the project's current identity.

func New

func New(rootPath, repoOwner, projectName string) *Sync

func (*Sync) Run

func (s *Sync) Run() ([]string, error)

Run reconciles the workspace against the project's owner and name. It reconciles every go.mod — the module directive plus any require or replace directive that names the old namespace — then, when the namespace root actually moved, rewrites the import paths across all Go sources so they resolve again. It returns the paths of every file changed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL