can use getnumber instead of casting
Ted Unangst tedu@tedunangst.com
Thu, 10 Sep 2020 15:04:29 -0400
3 files changed,
7 insertions(+),
5 deletions(-)
M
activity.go
→
activity.go
@@ -830,8 +830,8 @@ }
if tt == "Place" { p := new(Place) p.Name = name - p.Latitude, _ = tag["latitude"].(float64) - p.Longitude, _ = tag["longitude"].(float64) + p.Latitude, _ = tag.GetNumber("latitude") + p.Longitude, _ = tag.GetNumber("longitude") p.Url, _ = tag.GetString("url") xonk.Place = p }@@ -861,8 +861,8 @@ if loca, ok := obj.GetMap("location"); ok {
if tt, _ := loca.GetString("type"); tt == "Place" { p := new(Place) p.Name, _ = loca.GetString("name") - p.Latitude, _ = loca["latitude"].(float64) - p.Longitude, _ = loca["longitude"].(float64) + p.Latitude, _ = loca.GetNumber("latitude") + p.Longitude, _ = loca.GetNumber("longitude") p.Url, _ = loca.GetString("url") xonk.Place = p }
M
go.mod
→
go.mod
@@ -9,5 +9,5 @@ github.com/mattn/go-runewidth v0.0.6
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.6.43 + humungus.tedunangst.com/r/webs v0.6.44 )
M
go.sum
→
go.sum
@@ -24,3 +24,5 @@ humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI=
humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= humungus.tedunangst.com/r/webs v0.6.43 h1:V7tmvzXi/LETO2QfHyqvIivi1kbjRSHQoDFcR3hML+k= humungus.tedunangst.com/r/webs v0.6.43/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= +humungus.tedunangst.com/r/webs v0.6.44 h1:Y/Glxq/j8/AUXHl3cD82GbQ+6Cz3Y3CtvWsi/001w4Q= +humungus.tedunangst.com/r/webs v0.6.44/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps=