type action func(in *ast.File)
var filemap = map[string]action{
+ "alias.go": nil,
"array.go": nil,
"basic.go": nil,
"chan.go": nil,
"universe.go": fixGlobalTypVarDecl,
"util_test.go": fixTokenPos,
"validtype.go": nil,
- "version_test.go": nil,
}
// TODO(gri) We should be able to make these rewriters more configurable/composable.
n.Args[0] = arg
return false
}
+ case "allowVersion":
+ // rewrite check.allowVersion(..., pos, ...) to check.allowVersion(..., posn, ...)
+ if ident, _ := n.Args[1].(*ast.Ident); ident != nil && ident.Name == "pos" {
+ pos := n.Args[1].Pos()
+ arg := newIdent(pos, "posn")
+ n.Args[1] = arg
+ return false
+ }
}
}
}