From 1e3464112a963d05197929f18ce3e951d7f5c1b2 Mon Sep 17 00:00:00 2001 From: Mendel E Date: Sun, 28 Aug 2022 17:49:01 -0400 Subject: [PATCH] Skip empty tracking numbers --- utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.go b/utils.go index 25cf508..9ec6294 100644 --- a/utils.go +++ b/utils.go @@ -50,6 +50,11 @@ type Tracking struct { } func (t *Tracking) UnmarshalText(data []byte) error { + // skip if empty + if len(data) == 0 { + return nil + } + parts := strings.FieldsFunc(string(data), func(r rune) bool { return r == '(' || r == ')' }) -- 2.45.2