exec

package
v0.0.0-...-80248e1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(args string) (outStr string, errStr string, err error)

Command 调用 linux 命令

args:"chmod +x /xx/xx/x.sh"

func CommandAsyncStdout

func CommandAsyncStdout(name string, args string, funcStdout FuncAsyncStd, funcStderr FuncAsyncStd) (err error)

CommandAsyncStdout 异步执行命令,并返回标准输出

name:命令名称,默认为 /bin/bash
或者 "C:\\Program Files\\Git\\bin\\bash.exe"
args:"chmod +x /xx/xx/x.sh"
funcStdout nil:disable stdout
funcStderr nil:disable stderr

Types

type FuncAsyncStd

type FuncAsyncStd func(data string) int

Jump to

Keyboard shortcuts

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