You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
543 B
33 lines
543 B
6 months ago
|
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
|
||
|
}
|