Initial commit

This commit is contained in:
2026-06-30 15:14:37 +08:00
commit 15dab96872
311 changed files with 95639 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/shirou/gopsutil/v4/host"
)
func main() {
hostInfo, err := host.Info()
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("Hostname: %s\n", hostInfo.Hostname)
fmt.Printf("OS: %s\n", hostInfo.OS)
fmt.Printf("Platform: %s\n", hostInfo.Platform)
fmt.Printf("OS Version: %s\n", hostInfo.PlatformVersion)
fmt.Printf("Kernel: %s\n", hostInfo.KernelVersion)
fmt.Printf("Uptime: %d seconds\n", hostInfo.Uptime)
}