From 62c463823dce4962267fa8a0ea196ab9940a05a3 Mon Sep 17 00:00:00 2001 From: Shaun Dunning Date: Thu, 8 Nov 2018 11:16:50 -0500 Subject: [PATCH] bugfix: store ptr to MatcherKeys in case user registered matchers are used. --- match.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/match.go b/match.go index 0368567..74e956d 100644 --- a/match.go +++ b/match.go @@ -12,7 +12,7 @@ import ( var Matchers = matchers.Matchers // MatcherKeys is an alias to matchers.MatcherKeys -var MatcherKeys = matchers.MatcherKeys +var MatcherKeys = &matchers.MatcherKeys // NewMatcher is an alias to matchers.NewMatcher var NewMatcher = matchers.NewMatcher @@ -24,7 +24,7 @@ func Match(buf []byte) (types.Type, error) { return types.Unknown, ErrEmptyBuffer } - for _, kind := range MatcherKeys { + for _, kind := range *MatcherKeys { checker := Matchers[kind] match := checker(buf) if match != types.Unknown && match.Extension != "" {