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

hooks

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hooks executes user-defined hook commands with a timeout and optional environment-variable injection. It is shared between worktree-create hooks and (future) command lifecycle hooks.

Index

Constants

View Source
const DefaultTimeout = 60 * time.Second

DefaultTimeout is the maximum duration a hook can run before being killed.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, command, dir string, env []string, timeout time.Duration) error

Run executes a single hook command via `sh -c`.

dir sets the working directory for the spawned process. env, if non-empty, is appended to os.Environ() for the process. stdout/stderr are inherited from the current process so hook output reaches the user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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