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

shellcmd

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package shellcmd separates what a shell command runs from the data in it, so that the rules do not take the text of a file or a message for a command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(cmd string) string

Code is WithoutHeredocs with the text inside quotes removed, except a script that sh -c, eval or ssh runs. The quotes stay, so `git commit -m "rm -rf"` becomes `git commit -m ""`.

func Segment

func Segment(s string, i int) string

Segment returns the simple command around byte offset i of s, for example "rm -rf build" from "make && rm -rf build; ls".

func WithoutHeredocs

func WithoutHeredocs(cmd string) string

WithoutHeredocs removes the bodies of heredocs. A body is input data, for example the content of a file that the command writes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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