kruntime

package
v0.0.0-...-f638652 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumCPU

func NumCPU() int

NumCPU 返回当前进程可用的逻辑cpu数量

通过查询操作系统来检查可用的cpu集,调用了go lib中runtime.NumCPU函数

func PathRunDir

func PathRunDir() string

PathRunDir 返回当前程序运行目录的绝对路径

默认kercylan-lib库的kruntime包在被调用之处便通过初始化获取了当前应用程序运行的根目录绝对路径 由于os.Args[0]获取的是应用程序的运行路径,那么通过filepath.Dir获取到应用程序的运行目录后通过filepath.Abs将其转换确保其为一个绝对路径

func PathRunExe

func PathRunExe() string

PathRunExe 返回当前运行的应用程序的绝对路径

os.Args[0]得到的值直接表示了应用程序的运行路径,并且这是一个绝对路径 等同于os.Args[0]

func PathWork

func PathWork() string

PathWork 返回当前运行的应用程序的工作路径

等同于os.Getwd

Types

This section is empty.

Jump to

Keyboard shortcuts

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