mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-13 01:02:28 +08:00
doc: add document for GetOsBits function
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
|||||||
- [RemoveOsEnv](#RemoveOsEnv)
|
- [RemoveOsEnv](#RemoveOsEnv)
|
||||||
- [CompareOsEnv](#CompareOsEnv)
|
- [CompareOsEnv](#CompareOsEnv)
|
||||||
- [ExecCommand](#ExecCommand)
|
- [ExecCommand](#ExecCommand)
|
||||||
|
- [GetOsBits](#GetOsBits)
|
||||||
|
|
||||||
|
|
||||||
<div STYLE="page-break-after: always;"></div>
|
<div STYLE="page-break-after: always;"></div>
|
||||||
@@ -210,7 +211,7 @@ func main() {
|
|||||||
|
|
||||||
|
|
||||||
### <span id="ExecCommand">CompareOsEnv</span>
|
### <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>
|
<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)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ import (
|
|||||||
- [GetOsEnv](#GetOsEnv)
|
- [GetOsEnv](#GetOsEnv)
|
||||||
- [SetOsEnv](#SetOsEnv)
|
- [SetOsEnv](#SetOsEnv)
|
||||||
- [RemoveOsEnv](#RemoveOsEnv)
|
- [RemoveOsEnv](#RemoveOsEnv)
|
||||||
|
|
||||||
- [CompareOsEnv](#CompareOsEnv)
|
- [CompareOsEnv](#CompareOsEnv)
|
||||||
- [ExecCommand](#ExecCommand)
|
- [ExecCommand](#ExecCommand)
|
||||||
|
- [GetOsBits](#GetOsBits)
|
||||||
|
|
||||||
|
|
||||||
<div STYLE="page-break-after: always;"></div>
|
<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)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user