Help us shape the future of Go! Take the 2026 Go Developer Survey

local

package
v0.3.0-20261028150941-... Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package local implements gitworkspace.Workspace by executing commands as local subprocesses against a git clone on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(p Params) gitworkspace.Factory

NewFactory creates a gitworkspace.Factory that runs commands as local subprocesses in the given directory.

Types

type Params

type Params struct {
	// Dir is the path to the local git clone.
	Dir string
}

Params configures a local workspace factory.

type Runtime

type Runtime struct {
	// Executable is the absolute path to the Git executable.
	Executable string
	// ExecPath is the absolute directory containing Git's helper executables.
	ExecPath string
	// TemplateDir is the absolute directory containing Git's repository
	// templates.
	TemplateDir string
	// PassthroughEnv names additional environment variables to inherit from
	// the parent process, on top of the auth and transport ones always passed
	// through. For a deployment whose remote needs something unusual; leave
	// empty otherwise. Names that could alter merge semantics do not belong
	// here — the scrubbed environment is what keeps a merge reproducible.
	PassthroughEnv []string
}

Runtime identifies the explicitly provided Git runtime that commands run on.

func (Runtime) Command

func (r Runtime) Command(ctx context.Context, dir string, args ...string) *exec.Cmd

Command constructs a Git command without inheriting the caller's environment. The executable and helper paths come from the pinned runtime; repository-local configuration remains an intentional input.

func (Runtime) Validate

func (r Runtime) Validate() error

Validate reports whether every path of the runtime is set and absolute.

Jump to

Keyboard shortcuts

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