floattest.go (292B)
1 package main 2 3 import ( 4 "encoding/json" 5 "fmt" 6 ) 7 8 type FCont struct { 9 Ftest float64 10 Itest int 11 } 12 13 var tester = `{ 14 "Ftest": 423 15 }` 16 17 func main() { 18 var fc FCont 19 if err := json.Unmarshal([]byte(tester), &fc); err != nil { 20 fmt.Println(err) 21 } 22 fmt.Println(fc.Ftest) 23 fmt.Println(fc.Itest) 24 }