mirror of https://github.com/shirou/gopsutil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
392 B
Go
26 lines
392 B
Go
package gopsutil
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestVirtual_memory(t *testing.T) {
|
|
v, err := Virtual_memory()
|
|
if err != nil {
|
|
t.Errorf("error %v", err)
|
|
}
|
|
d, _ := json.Marshal(v)
|
|
fmt.Printf("%s\n", d)
|
|
}
|
|
|
|
func TestSwap_memory(t *testing.T) {
|
|
v, err := Swap_memory()
|
|
if err != nil {
|
|
t.Errorf("error %v", err)
|
|
}
|
|
d, _ := json.Marshal(v)
|
|
fmt.Printf("%s\n", d)
|
|
}
|