Closed jovandeginste closed 8 months ago
ping @pixelspark - I didn't think about this, all my minElevations were weird suddenly :smile:
Eh, right, should've caught that 🤣 (some background - I am fairly new to Go, but experienced in Rust where this can't happen because you need to either initialize new variables with a value or use an option type)
Eh, right, should've caught that 🤣 (some background - I am fairly new to Go, but experienced in Rust where this can't happen because you need to either initialize new variables with a value or use an option type)
This would be exactly the same, since you initialized it to 0.0
in your first version... Go just assumes you want the zero-value if you don't specify an explicit value...
Eh, right, should've caught that 🤣 (some background - I am fairly new to Go, but experienced in Rust where this can't happen because you need to either initialize new variables with a value or use an option type)
This would be exactly the same, since you initialized it to
0.0
in your first version... Go just assumes you want the zero-value if you don't specify an explicit value...
Yeah no type system will fix sleepy programmers :-)
If we start at 0m elevation, the chance is real this will always be lower than any actual elevation. We now initialize it at 100km, which ... should realistically be higher than any real minimal elevation.
Finally, we will make sure it is not higher than the maxElevation.