[ Cmii ] [ Octopus ] - reformat agent-go - 1

This commit is contained in:
zeaslity
2024-03-29 11:39:14 +08:00
parent aa4412f042
commit 1be48aaac2
52 changed files with 683 additions and 557 deletions

View File

@@ -0,0 +1,33 @@
package a_status
import (
"encoding/json"
"fmt"
"testing"
"wdd.io/agent-common/utils"
)
func TestGetDiskStatus(t *testing.T) {
ds := GetDiskStatus()
fmt.Printf("Total: %v, Used: %v\n", ds.Total, ds.Used)
marshalIndent, err := json.MarshalIndent(ds, "", " ")
if err != nil {
fmt.Printf("error")
}
fmt.Println(string(marshalIndent))
}
func TestGetDiskInfo(t *testing.T) {
diskInfo, err := GetDiskInfo()
if err != nil {
t.Errorf("get disk info error ! => %v", err)
}
utils.BeautifulPrint(diskInfo)
}