From 6ccf9fd3cf80db3bc97b9363e289825a58facb3e Mon Sep 17 00:00:00 2001 From: dudaodong Date: Thu, 21 Jul 2022 11:05:17 +0800 Subject: [PATCH] doc: add document for GetOsBits function --- docs/system.md | 25 +++++++++++++++++++++++-- docs/system_zh-CN.md | 26 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/docs/system.md b/docs/system.md index f8d51ca..377be3b 100644 --- a/docs/system.md +++ b/docs/system.md @@ -28,6 +28,7 @@ import ( - [RemoveOsEnv](#RemoveOsEnv) - [CompareOsEnv](#CompareOsEnv) - [ExecCommand](#ExecCommand) +- [GetOsBits](#GetOsBits)
@@ -210,7 +211,7 @@ func main() { ### CompareOsEnv -

use shell /bin/bash -c(linux) or cmd (windows) to execute command.

+

Use shell /bin/bash -c(linux) or cmd (windows) to execute command.

Signature: @@ -236,7 +237,27 @@ func main() { - +### GetOsBits +

Get current os bits, 32bit or 64bit. return 32 or 64

+ +Signature: + +```go +func GetOsBits() int +``` +Example: + +```go +import ( + "fmt" + "github.com/duke-git/lancet/v2/system" +) + +func main() { + osBit := system.GetOsBits() + fmt.Println(osBit) +} +``` diff --git a/docs/system_zh-CN.md b/docs/system_zh-CN.md index 4c3792b..3ac5987 100644 --- a/docs/system_zh-CN.md +++ b/docs/system_zh-CN.md @@ -26,8 +26,10 @@ import ( - [GetOsEnv](#GetOsEnv) - [SetOsEnv](#SetOsEnv) - [RemoveOsEnv](#RemoveOsEnv) + - [CompareOsEnv](#CompareOsEnv) - [ExecCommand](#ExecCommand) +- [GetOsBits](#GetOsBits)
@@ -236,6 +238,30 @@ func main() { +### GetOsBits +

获取当前操作系统位数,返回32或64

+ +函数签名: + +```go +func GetOsBits() int +``` +例子: + +```go +import ( + "fmt" + "github.com/duke-git/lancet/v2/system" +) + +func main() { + osBit := system.GetOsBits() + fmt.Println(osBit) +} +``` + + +