/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
os/gproc/gproc_must.go
35 строк
968 B
John Guo
add tracing feature for package gproc (#1923)
21 июн 2022, 16:46
Не верифицирован
21 июн 2022, 16:46
2bcee01
Код
Авторство
О чём код?
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gproc import ( "context" "io" ) // MustShell performs as Shell, but it panics if any error occurs. func MustShell(ctx context.Context, cmd string, out io.Writer, in io.Reader) { if err := Shell(ctx, cmd, out, in); err != nil { panic(err) } } // MustShellRun performs as ShellRun, but it panics if any error occurs. func MustShellRun(ctx context.Context, cmd string) { if err := ShellRun(ctx, cmd); err != nil { panic(err) } } // MustShellExec performs as ShellExec, but it panics if any error occurs. func MustShellExec(ctx context.Context, cmd string, environment ...[]string) string { result, err := ShellExec(ctx, cmd, environment...) if err != nil { panic(err) } return result }