system

package
v0.0.0-...-6d4b899 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package system Date: 2023/7/11 18:28 Author: Amu Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(command string, opts ...Option) (stdout, stderr string, err error)

ExecCommand execute command, return the stdout and stderr string of command, and error if error occur param `command` is a complete command string, like, ls -a (linux), dir(windows), ping 127.0.0.1 in linux, use /bin/bash -c to execute command in windows, use powershell.exe to execute command

func GetOsBits

func GetOsBits() int

GetOsBits return current os bits (32 or 64). Play: https://go.dev/play/p/ml-_XH3gJbW

func GetOsEnv

func GetOsEnv(key string) string

func IsLinux

func IsLinux() bool

func IsMac

func IsMac() bool

func IsWindows

func IsWindows() bool

func RemoveOsEnv

func RemoveOsEnv(key string) error

func SetOsEnv

func SetOsEnv(key, value string) error

Types

type Option

type Option func(*exec.Cmd)

Jump to

Keyboard shortcuts

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