1. sweemeng
  2. GtugGoSandbox

Commits

sweemeng  committed f419c54

generate a list of positions

  • Participants
  • Parent commits 569c532
  • Branches default

Comments (0)

Files changed (1)

File goproj/positions/positions.go

View file
         w.WriteHeader(http.StatusFound)
         return
     }
-
-    p := Position{u.String(),[2]float32{3.10593+rand.Float32(),101.66478+rand.Float32()}}
-    b,err := json.Marshal(p)
+    count := 10
+    parr := []Position{}
+    for i := 1; i<=count; i++ {
+        parr = append(parr,Position{u.String(),[2]float32{3.10593+rand.Float32(),101.66478+rand.Float32()}})
+    }
+    b,err := json.Marshal(parr)
     if err != nil{
         http.Error(w,err.String(),http.StatusInternalServerError)
         return
     }
     fmt.Fprint(w,string(b))
+
+
 }