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

hooktest

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package hooktest runs the test binary itself as a hook command, so hook tests behave the same under sh on Unix and cmd.exe on Windows (2.0 F0).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(t testing.TB, args ...string) string

Command returns a hook command line that runs this test binary as the helper with args. Args must avoid ", $, % and backquotes: the line is parsed by sh on Unix and cmd.exe on Windows.

func RunIfHelper

func RunIfHelper()

RunIfHelper must be the first call in TestMain. When Command started this process, it acts as the hook and exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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