From 4ddcb0ea738c181070039db8d9fed9f81958424c Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 17 Dec 2009 15:23:19 -0800 Subject: [PATCH] fix for gofmt rewrite matcher bug R=rsc CC=golang-dev https://golang.org/cl/179096 --- src/cmd/gofmt/rewrite.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go index 94f7912a38b..0fade9f1c1d 100644 --- a/src/cmd/gofmt/rewrite.go +++ b/src/cmd/gofmt/rewrite.go @@ -134,6 +134,9 @@ func match(m map[string]reflect.Value, pattern, val reflect.Value) bool { p := reflect.Indirect(pattern) v := reflect.Indirect(val) + if p == nil || v == nil { + return p == nil && v == nil + } switch p := p.(type) { case *reflect.SliceValue: