diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go index 631c513310c..47d1ac46ce0 100644 --- a/src/cmd/gofmt/rewrite.go +++ b/src/cmd/gofmt/rewrite.go @@ -19,6 +19,7 @@ import ( func initRewrite() { if *rewriteRule == "" { + rewrite = nil // disable any previous rewrite return } f := strings.Split(*rewriteRule, "->", -1)