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

test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package test implements the `[` and `test` shell built-ins.

`[ EXPR ]` — required closing `]`. `test EXPR` — no closing bracket. Supports the POSIX-shape tests: string (-z/-n/=/!=), integer (-eq, -ne, -lt, -le, -gt, -ge), file (-e, -f, -d, -r, -w, -x, -s), unary `!` negation, binary `-a` / `-o` (deprecated but ubiquitous), and parentheses.

mvdan/sh ships its own; reachable via /bin/[ and /bin/test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBracket

func NewBracket() command.Command

NewBracket returns the `[` command.

func NewTest

func NewTest() command.Command

NewTest returns the `test` command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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