1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-06 05:42:25 +08:00

doc: add document for GetOsBits function

This commit is contained in:
dudaodong
2022-07-21 11:05:17 +08:00
parent c02ef2c62d
commit 6ccf9fd3cf
2 changed files with 49 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ import (
- [RemoveOsEnv](#RemoveOsEnv)
- [CompareOsEnv](#CompareOsEnv)
- [ExecCommand](#ExecCommand)
- [GetOsBits](#GetOsBits)
<div STYLE="page-break-after: always;"></div>
@@ -210,7 +211,7 @@ func main() {
### <span id="ExecCommand">CompareOsEnv</span>
<p>use shell /bin/bash -c(linux) or cmd (windows) to execute command.</p>
<p>Use shell /bin/bash -c(linux) or cmd (windows) to execute command.</p>
<b>Signature:</b>
@@ -236,7 +237,27 @@ func main() {
### <span id="GetOsBits">GetOsBits</span>
<p>Get current os bits, 32bit or 64bit. return 32 or 64</p>
<b>Signature:</b>
```go
func GetOsBits() int
```
<b>Example:</b>
```go
import (
"fmt"
"github.com/duke-git/lancet/v2/system"
)
func main() {
osBit := system.GetOsBits()
fmt.Println(osBit)
}
```

View File

@@ -26,8 +26,10 @@ import (
- [GetOsEnv](#GetOsEnv)
- [SetOsEnv](#SetOsEnv)
- [RemoveOsEnv](#RemoveOsEnv)
- [CompareOsEnv](#CompareOsEnv)
- [ExecCommand](#ExecCommand)
- [GetOsBits](#GetOsBits)
<div STYLE="page-break-after: always;"></div>
@@ -236,6 +238,30 @@ func main() {
### <span id="GetOsBits">GetOsBits</span>
<p>获取当前操作系统位数返回32或64</p>
<b>函数签名:</b>
```go
func GetOsBits() int
```
<b>例子:</b>
```go
import (
"fmt"
"github.com/duke-git/lancet/v2/system"
)
func main() {
osBit := system.GetOsBits()
fmt.Println(osBit)
}
```