summaryrefslogtreecommitdiff
path: root/src/cmd/gofix/httpheaders.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gofix/httpheaders.go')
-rw-r--r--src/cmd/gofix/httpheaders.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmd/gofix/httpheaders.go b/src/cmd/gofix/httpheaders.go
index 8a9080e8e..15c21ac86 100644
--- a/src/cmd/gofix/httpheaders.go
+++ b/src/cmd/gofix/httpheaders.go
@@ -8,8 +8,13 @@ import (
"go/ast"
)
+func init() {
+ register(httpHeadersFix)
+}
+
var httpHeadersFix = fix{
"httpheaders",
+ "2011-06-16",
httpheaders,
`Rename http Referer, UserAgent, Cookie, SetCookie, which are now methods.
@@ -17,10 +22,6 @@ http://codereview.appspot.com/4620049/
`,
}
-func init() {
- register(httpHeadersFix)
-}
-
func httpheaders(f *ast.File) bool {
if !imports(f, "http") {
return false
@@ -35,7 +36,7 @@ func httpheaders(f *ast.File) bool {
})
fixed := false
- typeof := typecheck(headerTypeConfig, f)
+ typeof, _ := typecheck(headerTypeConfig, f)
walk(f, func(ni interface{}) {
switch n := ni.(type) {
case *ast.SelectorExpr:
@@ -60,7 +61,7 @@ func httpheaders(f *ast.File) bool {
var headerTypeConfig = &TypeConfig{
Type: map[string]*Type{
- "*http.Request": &Type{},
- "*http.Response": &Type{},
+ "*http.Request": {},
+ "*http.Response": {},
},
}