[Agent][Bastion] - Bastion mode - 2
This commit is contained in:
@@ -1,27 +1,5 @@
|
||||
package bastion_init
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
// getStandardOutPutLength 获取到标准输出终端的长度
|
||||
func getStandardOutPutLength() (int, error) {
|
||||
buffer := make([]byte, 0)
|
||||
_, err := io.ReadFull(os.Stdout, buffer)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return len(buffer), nil
|
||||
}
|
||||
|
||||
func PrintBastionHelp() {
|
||||
length, err := getStandardOutPutLength()
|
||||
if err == nil {
|
||||
fmt.Printf("标准输出终端的长度: %d 字节\n", length)
|
||||
} else {
|
||||
fmt.Println("获取标准输出终端长度时发生错误:", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user