system

package
v0.0.0-...-512269d Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package system contain some functions about os, runtime, shell command

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareOsEnv

func CompareOsEnv(key, comparedEnv string) bool

CompareOsEnv gets env named by the key and compare it with comparedEnv

func ExecCommand

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

ExecCommand use shell /bin/bash -c to execute command

func GetOsEnv

func GetOsEnv(key string) string

GetOsEnv Getenv retrieves the value of the environment variable named by the key. It returns the value, which will be empty if the variable is not present. To distinguish between an empty value and an unset value, use os.LookupEnv.

func IsLinux

func IsLinux() bool

func IsMac

func IsMac() bool

func IsWindow

func IsWindow() bool

func SetOsEnv

func SetOsEnv(key, value string) error

SetOsEnv sets the value of the environment variable named by the key. It returns an error, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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