Golang Quirk: Number-strings starting with “0” are Octals
scripter.co
scripter.co
The idea for strconv originates in c (see atoi etc), and c also has 0-octal notation.
Go is simply mimicing c in this regard.
> What was the Golang team thinking?!
They were helping you not misuse the function, as you are doing in your example (you are trying to parse strings containing invalid number representations as integers).
A better solution is to always provide the base (e.g. 10) rather than using 0 if you don't want special interpretation of '0x' and '0' prefixes. That should be in Hugo. The problem is not with the golang library which was well documented and always worked as such. By placing any blame on the golang library, there's less incentive to fix Hugo.
[1]: https://github.com/gohugoio/hugo/issues/4628#issuecomment-38...