~mendelmaleh/amazon

1e3464112a963d05197929f18ce3e951d7f5c1b2 — Mendel E 2 years ago b354f49
Skip empty tracking numbers
1 files changed, 5 insertions(+), 0 deletions(-)

M utils.go
M utils.go => utils.go +5 -0
@@ 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 == ')'
	})