From 95e5ef613f450414566f1bbf2c2c2977551a05ff Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Sun, 21 Nov 2021 17:38:52 +0100 Subject: [PATCH] Set default value of version to -1 --- guessit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guessit.go b/guessit.go index fddfcba..62b34d0 100644 --- a/guessit.go +++ b/guessit.go @@ -122,6 +122,10 @@ func (g Guessit) Guessit(s string, options ...string) (out Match, err error) { } } + if _, ok := tmpmap["version"]; !ok { + tmpmap["version"] = -1 + } + config := &mapstructure.DecoderConfig{ WeaklyTypedInput: true, Result: &out,