exec

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package exec provides command execution with mocking support for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutor

type CommandExecutor interface {
	// Execute runs a command with the given name and arguments.
	// Returns stdout, stderr, and any error.
	Execute(name string, args ...string) (stdout, stderr string, err error)
}

CommandExecutor defines an interface for executing external commands. This allows us to mock command execution in tests.

type RealExecutor

type RealExecutor struct{}

RealExecutor executes actual system commands.

func NewRealExecutor

func NewRealExecutor() *RealExecutor

NewRealExecutor creates an executor that runs real commands.

func (*RealExecutor) Execute

func (*RealExecutor) Execute(name string, args ...string) (stdout, stderr string, err error)

Execute runs the actual command using os/exec. It includes a safety check to prevent accidental mutation of GitHub resources during tests.

Jump to

Keyboard shortcuts

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