[ 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,36 @@
package a_status
import (
"encoding/json"
"fmt"
"testing"
)
func TestGetCPUStatus(t *testing.T) {
cpuStatus, err := GetCPUMetric()
if err != nil {
return
}
marshalIndent, err := json.MarshalIndent(cpuStatus, "", " ")
if err != nil {
fmt.Printf("error")
}
fmt.Println(string(marshalIndent))
}
func TestGetCPUInfo(t *testing.T) {
cpuInfo, err := GetCPUInfo()
if err != nil {
return
}
marshalIndent, err := json.MarshalIndent(cpuInfo, "", " ")
if err != nil {
fmt.Printf("error")
}
fmt.Println(string(marshalIndent))
}