system

package
v2.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 4 Imported by: 2

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 GetOsBits added in v2.1.3

func GetOsBits() int

GetOsBits get this system bits 32bit or 64bit return bit int (32/64)

func GetOsEnv

func GetOsEnv(key string) string

GetOsEnv gets the value of the environment variable named by the key.

func IsLinux

func IsLinux() bool

IsLinux check if current os is linux

func IsMac

func IsMac() bool

IsMac check if current os is macos

func IsWindows

func IsWindows() bool

IsWindows check if current os is windows

func RemoveOsEnv

func RemoveOsEnv(key string) error

RemoveOsEnv remove a single environment variable.

func SetOsEnv

func SetOsEnv(key, value string) error

SetOsEnv sets the value of the environment variable named by the key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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