system

package
v0.0.0-...-9a41f76 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package system 包含一些关于操作系统、运行时间、shell命令的功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareOsEnv

func CompareOsEnv(key, comparedEnv string) bool

CompareOsEnv 获取由键值命名的环境,并将其与compareEnv进行比较

func ExecCommand

func ExecCommand(command string) (stdout, stderr string, err error)

ExecCommand 使用shell /bin/bash -c来执行命令

func GetOsEnv

func GetOsEnv(key string) string

GetOsEnv 获取由键命名的环境变量的值

func IsLinux

func IsLinux() bool

IsLinux 检查当前操作系统是否为Linux

func IsMac

func IsMac() bool

IsMac 检查当前操作系统是否为Macos

func IsWindows

func IsWindows() bool

IsWindows 检查当前操作系统是否为Windows

func RemoveOsEnv

func RemoveOsEnv(key string) error

RemoveOsEnv 删除一个环境变量

func SetOsEnv

func SetOsEnv(key, value string) error

SetOsEnv 设置由键命名的环境变量的值

Types

This section is empty.

Jump to

Keyboard shortcuts

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