From 9f0958ef5d44ce961dbaf2116f0ccc10987f5046 Mon Sep 17 00:00:00 2001 From: Gregor Best <gbe@unobtanium.de> Date: Sat, 22 May 2021 15:51:09 +0200 Subject: [PATCH] Tread unreadable countries as "unknown" --- vino.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vino.go b/vino.go index 2f78b36..3b0226c 100644 --- a/vino.go +++ b/vino.go @@ -55,7 +55,8 @@ func (i *ISO2CountryCode) UnmarshalBinary(d []byte) error { } if len(d) != 2 { - return errors.New("invalid length") + *i = UnknownCountry + return nil } *i = ISO2CountryCode{d[0], d[1]} -- GitLab