From e96bd75f84b783831868c7242bf110c13cceee5e Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 23 Jan 2018 13:57:52 +0900 Subject: [PATCH] Fix bug matchers are ignored except last one --- cmux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmux.go b/cmux.go index 9de6b0a..1b60e09 100644 --- a/cmux.go +++ b/cmux.go @@ -115,7 +115,8 @@ type cMux struct { func matchersToMatchWriters(matchers []Matcher) []MatchWriter { mws := make([]MatchWriter, 0, len(matchers)) - for _, m := range matchers { + for _, _m := range matchers { + m := _m mws = append(mws, func(w io.Writer, r io.Reader) bool { return m(r) })