cmdexec

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 13 Imported by: 0

README

サンプルリスト

このディレクトリには以下のサンプルがあります。

file example name note
oneshot.go cmdexec_oneshot コマンドを一発実行して結果を取得するサンプルです
oneshotwithstderr.go cmdexec_oneshot_with_stderr コマンドを一発実行して結果を取得するサンプルです。(標準エラー出力も含む)
stdinouterr.go cmdexec_stdinouterr 標準入力・標準出力・標準エラー出力を指定してコマンドを実行するサンプルです
withcontext.go cmdexec_withcontext コマンドを context.Context 付きで実行するサンプルです
pipe.go cmdexec_pipe (*Cmd).StdinPipe,StdoutPipe,StderrPipeのサンプルです
multi_command_with_pipe.go cmdexec_multi_command_with_pipe 複数の (*exec.Cmd) をパイプストリームで繋いで実行するサンプルです
withenv.go cmdexec_env *exec.Cmd 実行時に追加の環境変数を指定するサンプルです
withdir.go cmdexec_dir *exec.Cmd 実行時にワーキングディレクトリを指定するサンプルです
withslice.go cmdexec_slice *exec.Cmd 実行時にスライスの値をコマンドの引数で指定するサンプルです

Documentation

Overview

Package cmdexec -- コマンド実行についてのサンプルが配置されているパッケージです。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiCommandWithPipe added in v0.2.8

func MultiCommandWithPipe() error

MultiCommandWithPipe は、複数の (*exec.Cmd) をパイプストリームで繋いで実行するサンプルです.

func NewRegister

func NewRegister() mapping.Register

NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。

func OneShotWithStderr

func OneShotWithStderr() error

OneShotWithStderr は、コマンドを一発実行して結果を取得するサンプルです。(標準エラー出力も含む)

REFERENCES:

func Pipe

func Pipe() error

Pipe は、 (*Cmd).StdinPipe,StdoutPipe,StderrPipeのサンプルです。

REFERENCES:

func Stdinouterr

func Stdinouterr() error

Stdinouterr は、標準入力・標準出力・標準エラー出力を指定してコマンドを実行するサンプルです。

REFERENCES:

func WithContext

func WithContext() error

WithContext は、context.Context 付きでコマンドを実行するサンプルです。

func WithDir added in v0.4.1

func WithDir() error

WithDir -- *exec.Cmd 実行時にワーキングディレクトリを指定するサンプルです.

REFERENCES

func WithEnv added in v0.4.1

func WithEnv() error

WithEnv -- *exec.Cmd 実行時に追加の環境変数を指定するサンプルです.

REFERENCES

func WithSlice added in v0.4.1

func WithSlice() error

WithSlice -- *exec.Cmd 実行時にスライスの値をコマンドの引数で指定するサンプルです.

REFERENCES

Types

This section is empty.

Jump to

Keyboard shortcuts

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