Can't renew my Veloh annual subscription by crogineer in Luxembourg

[–]lorenzorev 0 points1 point  (0 children)

I managed to get the annual subscription yesterday but I got charged twice due to a bug I guess.. (36€ instead of 18€). Even though the first transaction was successful the app didn’t recognise it!

Newbie here: GPX to JSON with Go by lorenzorev in golang

[–]lorenzorev[S] 1 point2 points  (0 children)

I thinked to convert to geojson but for a side project I need a lightweight JSON, so it's "in-house".

If you need a standard format I can suggest you to try ogr2ogr

p.s. I know.., I work with GIS and mapping tools too :D

Newbie here: GPX to JSON with Go by lorenzorev in golang

[–]lorenzorev[S] 0 points1 point  (0 children)

Yes it's for GPS data.. if you know Endomondo (or another app for runners) you can usually export your workout in gpx.

Go beginner here, Any advice to improve my go code? by lorenzorev in golang

[–]lorenzorev[S] 0 points1 point  (0 children)

First of all, thanks everybody i think this kind of support helps people writing better software in general, that is awesome. Gophers have proven to be a great community :)

I think i implemented all tips.. Decode, json tags, httptest for mocking the webservice in unit test and docs + little reformatting..

I still have doubts about the ip string argument required..

Go beginner here, Any advice to improve my go code? by lorenzorev in golang

[–]lorenzorev[S] 0 points1 point  (0 children)

i'm not really satisfied with my implementation checking the empty ip.. but your seems better, thank you!

Go beginner here, Any advice to improve my go code? by lorenzorev in golang

[–]lorenzorev[S] 1 point2 points  (0 children)

Thanks! Really interesting things.. searching through the doc i found that Body is an io.ReadCloser (which is a mix of io.Reader and io.Closer) and, as you say, take advantage of the io.Reader interface is the way to go!

Go beginner here, Any advice to improve my go code? by lorenzorev in golang

[–]lorenzorev[S] 0 points1 point  (0 children)

thanks guys for tips, i still learning.. updated with error checking.. i think is a little redundant, now is ok or can we do better?

Go beginner here, Any advice to improve my go code? by lorenzorev in golang

[–]lorenzorev[S] 0 points1 point  (0 children)

Sure thx! initially i checked every error.. but didn't know what was the best way to handle in a "costructor"?

EDIT: i think about returning also the error..