package core import ( "encoding/json" "fmt" "testing" ) func TestGetDevice(t *testing.T) { devices, err := GetAllDevice() if err != nil { t.Fatal(err) } for _, device := range devices { println("--------") j, _ := json.MarshalIndent(device, "", " ") //fmt.Printf("%+v\n", device) println(string(j)) } } func TestName(t *testing.T) { a := []int{1, 2, 3, 4, 5} fmt.Printf("%+v\n", a) as(a) fmt.Printf("%+v\n", a) } func as(a []int) { a[1] = 500 }