1
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
15
`Adapt code from filepath.[List]SeparatorString to string(filepath.[List]Separator).
17
http://codereview.appspot.com/4527090
22
func filepathFunc(f *ast.File) (fixed bool) {
23
if !imports(f, "path/filepath") {
27
walk(f, func(n interface{}) {
28
e, ok := n.(*ast.Expr)
35
case isPkgDot(*e, "filepath", "SeparatorString"):
36
ident = "filepath.Separator"
37
case isPkgDot(*e, "filepath", "ListSeparatorString"):
38
ident = "filepath.ListSeparator"
43
// string(filepath.[List]Separator)
45
Fun: ast.NewIdent("string"),
46
Args: []ast.Expr{ast.NewIdent(ident)},