Automatic country detection commonly panics #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GetDeviceCountry()treats the final component of an IANA timezone as a national capital. It then dereferences the country lookup result without checking fornil.Timezones whose representative city is not a capital, such as
America/New_YorkorAmerica/Chicago, therefore panic. Both CLI and TUI flows use this function when the country field is omitted.This was reproduced with
time.Localset toAmerica/New_York;GetByCapital("New_York")returnedniland the.Alpha2access panicked.