Guest User

Untitled

a guest
Mar 11th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.30 KB | None | 0 0
  1. func jsonify() string {
  2.     type Product struct {
  3.         id int
  4.         name string
  5.         time int64
  6.     }
  7.  
  8.     d = []Product
  9.  
  10.     d[0] := Product{0,"aaaaa", 1294706395881547000 }
  11.     d[1] := Product{1,"bbbbb", 1294706395881547000 }
  12.     d[2] := Product{2,"ccccc", 1294706395881547000 }
  13.  
  14.     j, err := json.Marshal(d)  
  15.     return j
  16. }
Add Comment
Please, Sign In to add comment