- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for deleteImport (0.12 sec)
-
src/cmd/fix/import_test.go
return func(f *ast.File) bool { if imports(f, path) { deleteImport(f, path) return true } return false } } func addDelImportFn(p1 string, p2 string) func(*ast.File) bool { return func(f *ast.File) bool { fixed := false if !imports(f, p1) { addImport(f, p1) fixed = true } if imports(f, p2) { deleteImport(f, p2) fixed = true } return fixed } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 23:34:33 UTC 2016 - 5K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go
// This logic is taken from golang.org/x/tools/imports package. return strings.Contains(importPath, ".") } // DeleteImport deletes the import path from the file f, if present. // If there are duplicate import declarations, all matching ones are deleted. func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { return DeleteNamedImport(fset, f, "", path) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 10 21:56:21 UTC 2022 - 13.4K bytes - Viewed (0) -
src/cmd/fix/fix.go
newImport.Path.ValuePos = prev.Pos() newImport.EndPos = prev.Pos() } f.Imports = append(f.Imports, newImport) return true } // deleteImport deletes the import path from the file f, if present. func deleteImport(f *ast.File, path string) (deleted bool) { oldImport := importSpec(f, path) // Find the import node that imports path, if any. for i, decl := range f.Decls {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 14.6K bytes - Viewed (0)