fmt
This commit is contained in:
@@ -35,14 +35,14 @@ func (sims *SensorItemMappingService) CreateAll(siml *[]*SensorItemMapping) (str
|
||||
|
||||
outlist := make([]string, 0)
|
||||
for _, sim := range *siml {
|
||||
out,err := sims.Create(sim)
|
||||
out, err := sims.Create(sim)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
outlist = append(outlist, out)
|
||||
}
|
||||
|
||||
bytes,err := json.Marshal(outlist)
|
||||
bytes, err := json.Marshal(outlist)
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -2,11 +2,11 @@ package sensorItemMapping
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/overflow_service/proxy/sensor"
|
||||
"testing"
|
||||
"fmt"
|
||||
"sync"
|
||||
"git.loafle.net/overflow/overflow_service/proxy/sensor"
|
||||
"strconv"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSensorItemMappingService_List(t *testing.T) {
|
||||
@@ -19,7 +19,6 @@ func TestSensorItemMappingService_List(t *testing.T) {
|
||||
t.Log(res)
|
||||
}
|
||||
|
||||
|
||||
func TestSensorItemMappingService_List_GoRutine(t *testing.T) {
|
||||
//s := &sensor.Sensor{}
|
||||
//s.Id = json.Number("14")
|
||||
@@ -36,7 +35,6 @@ func TestSensorItemMappingService_List_GoRutine(t *testing.T) {
|
||||
|
||||
for _, ii := range il {
|
||||
|
||||
|
||||
go func(i int) {
|
||||
s := &sensor.Sensor{}
|
||||
s.Id = json.Number(strconv.Itoa(ii))
|
||||
@@ -44,14 +42,12 @@ func TestSensorItemMappingService_List_GoRutine(t *testing.T) {
|
||||
fmt.Print(res)
|
||||
}(ii)
|
||||
|
||||
|
||||
}
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
|
||||
wg.Wait()
|
||||
|
||||
//res, _ := sims.List(s)
|
||||
|
||||
Reference in New Issue
Block a user