package
0.5.36
Repository: https://github.com/devlights/try-golang.git
Documentation: pkg.go.dev

# README

サンプルリスト

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

fileexample namenote
oneshot.gocmdexec_oneshotコマンドを一発実行して結果を取得するサンプルです
oneshotwithstderr.gocmdexec_oneshot_with_stderrコマンドを一発実行して結果を取得するサンプルです。(標準エラー出力も含む)
stdinouterr.gocmdexec_stdinouterr標準入力・標準出力・標準エラー出力を指定してコマンドを実行するサンプルです
withcontext.gocmdexec_withcontextコマンドを context.Context 付きで実行するサンプルです
pipe.gocmdexec_pipe(*Cmd).StdinPipe,StdoutPipe,StderrPipeのサンプルです
multi_command_with_pipe.gocmdexec_multi_command_with_pipe複数の (*exec.Cmd) をパイプストリームで繋いで実行するサンプルです
withenv.gocmdexec_env*exec.Cmd 実行時に追加の環境変数を指定するサンプルです
withdir.gocmdexec_dir*exec.Cmd 実行時にワーキングディレクトリを指定するサンプルです
withslice.gocmdexec_slice*exec.Cmd 実行時にスライスの値をコマンドの引数で指定するサンプルです

# Functions

MultiCommandWithPipe は、複数の (*exec.Cmd) をパイプストリームで繋いで実行するサンプルです.
NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。.
OneShot は、コマンドを一発実行して結果を取得するサンプルです.
OneShotWithStderr は、コマンドを一発実行して結果を取得するサンプルです。(標準エラー出力も含む) REFERENCES: - https://golang.org/os/exec/#example_Cmd_CombinedOutput - https://www.gnu.org/software/bash/manual/bash.html#Redirecting-Standard-Output-and-Standard-Error - https://tldp.org/LDP/abs/html/io-redirection.html.
Pipe は、 (*Cmd).StdinPipe,StdoutPipe,StderrPipeのサンプルです。 REFERENCES: - https://golang.org/os/exec/#example_Cmd_StdinPipe.
Stdinouterr は、標準入力・標準出力・標準エラー出力を指定してコマンドを実行するサンプルです。 REFERENCES: - https://golang.org/os/exec/#example_Command.
WithContext は、context.Context 付きでコマンドを実行するサンプルです。.
WithDir -- *exec.Cmd 実行時にワーキングディレクトリを指定するサンプルです.
WithEnv -- *exec.Cmd 実行時に追加の環境変数を指定するサンプルです.
WithSlice -- *exec.Cmd 実行時にスライスの値をコマンドの引数で指定するサンプルです.