system

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 4 Imported by: 19

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 v1.3.1

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